Преглед изворни кода

政策模块-编辑是否预付从否切换成是,垫付等字段展示

huangxuechao пре 4 година
родитељ
комит
db019bb3ad

+ 2 - 5
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/controller/CwjsPolicyInfoController.java

@@ -439,12 +439,9 @@ public class CwjsPolicyInfoController {
 				cwjsPolicyInfo.setDianPayCompanyName(null);
 				cwjsPolicyInfo.setDianPayCompanyRebateRate(null);
 			}
-			boolean ok = cwjsPolicyInfoService.updateById(cwjsPolicyInfo);
-			if(ok) {
-				result.success("修改成功!");
-			}
+			cwjsPolicyInfoService.updatePolicyInfoById(cwjsPolicyInfo);
+			result.success("修改成功!");
 		}
-
 		return result;
 	}
 

+ 2 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/mapper/CwjsPolicyInfoMapper.java

@@ -19,4 +19,6 @@ public interface CwjsPolicyInfoMapper extends BaseMapper<CwjsPolicyInfo> {
     List<JSONObject> getAllSale();
 
     List<JSONObject> getAllSaleByUserId(String userId);
+
+    void updatePolicyInfoById(CwjsPolicyInfo policyInfo);
 }

+ 29 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/mapper/xml/CwjsPolicyInfoMapper.xml

@@ -25,6 +25,10 @@
         <if test="startTime != null and startTime != ''">and t2.create_time &gt;= #{startTime}</if>
         <if test="endTime != null and endTime != ''">and t2.create_time &lt;= concat(#{endTime},' 23:59:59')</if>
         <if test="approvedProgress != null and approvedProgress != ''">and t2.approved_progress = #{approvedProgress}</if>
+        <if test="policyStartDate != null and policyStartDate != '' and policyEndDate != null and policyEndDate != ''">
+        and ((#{policyStartDate} &lt;= t2.policy_start_date and #{policyEndDate} &gt;= t2.policy_start_date)
+        or (#{policyStartDate} &gt;= t2.policy_start_date and #{policyStartDate} &lt;= t2.policy_end_date))
+        </if>
         order by t2.create_time desc
     </select>
 
@@ -59,4 +63,29 @@
         WHERE
             t1.approved_progress = #{userId} or t1.create_user_id = #{userId}
     </select>
+
+    <update id="updatePolicyInfoById">
+        update ctop_cwjs_policy_info set
+            company_name = #{companyName},
+             advertiser_name = #{advertiserName},
+             media_type = #{mediaType},
+             company_subject_id = #{companySubjectId},
+             group_abbreviation = #{groupAbbreviation},
+             approved_progress = #{approvedProgress},
+             advance_pay = #{advancePay},
+             accounting_period = #{accountingPeriod},
+             rebate_type = #{rebateType},
+             rebate_rate = #{rebateRate},
+             is_dian_pay = #{isDianPay},
+             dian_pay_company_name = #{dianPayCompanyName},
+             dian_pay_company_rebate_rate = #{dianPayCompanyRebateRate},
+             promotion_type = #{promotionType},
+             policy_start_date = #{policyStartDate},
+             policy_end_date = #{policyEndDate},
+             remarks = #{remarks},
+             create_user_id = #{createUserId},
+             create_user_name = #{createUserName}
+        where id = #{id}
+    </update>
+
 </mapper>

+ 4 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/service/ICwjsPolicyInfoService.java

@@ -24,4 +24,8 @@ public interface ICwjsPolicyInfoService extends IService<CwjsPolicyInfo> {
     List<String> getAllSubordinate(String userId);
 
     List<JSONObject> getAllSubordinate2(String userId);
+
+    boolean isExistCwjsPolicyInfo(CwjsPolicyInfo policyInfo);
+
+    void updatePolicyInfoById(CwjsPolicyInfo policyInfo);
 }

+ 22 - 0
jeecg-boot-finance/src/main/java/org/jeecg/ctop/finance/policy/service/impl/CwjsPolicyInfoServiceImpl.java

@@ -113,4 +113,26 @@ public class CwjsPolicyInfoServiceImpl extends ServiceImpl<CwjsPolicyInfoMapper,
         return mapList;
 
     }
+
+    @Override
+    public boolean isExistCwjsPolicyInfo(CwjsPolicyInfo policyInfo){
+        CwjsPolicyInfo cwjsPolicyInfoEntity = new CwjsPolicyInfo();
+        cwjsPolicyInfoEntity.setAdvertiserName(policyInfo.getAdvertiserName());
+        cwjsPolicyInfoEntity.setProductName(policyInfo.getProductName());
+        cwjsPolicyInfoEntity.setMediaType(policyInfo.getMediaType());
+        cwjsPolicyInfoEntity.setCreateUserId(policyInfo.getCreateUserId());
+        cwjsPolicyInfoEntity.setPolicyStartDate(policyInfo.getPolicyStartDate());
+        cwjsPolicyInfoEntity.setPolicyEndDate(policyInfo.getPolicyEndDate());
+        List<CwjsPolicyInfo> cwjsPolicyInfos = policyInfoMapper.selectPolicyInfos(policyInfo);
+        if(Check.isNull(cwjsPolicyInfos)){
+            return false;
+        }else {
+            return true;
+        }
+    }
+
+    @Override
+    public void updatePolicyInfoById(CwjsPolicyInfo policyInfo){
+        policyInfoMapper.updatePolicyInfoById(policyInfo);
+    }
 }