فهرست منبع

复制协议区分内外部协议、审核协议增加起止期筛选

Qchen 1 سال پیش
والد
کامیت
27f9f6f0c6

+ 21 - 18
src/main/java/com/ydtech/modules/protocol/service/impl/PtlAgreementServiceImpl.java

@@ -1019,6 +1019,7 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
                 .eq(PtlAgreement::getInsuranceCompanyId, ptlAgreement.getInsuranceCompanyId()));
     }
 
+    @Transactional
     @Override
     public HttpResult getAgreementCopy(PtlAgreementVo ptlAgreementVo) {
         PtlAgreement ptlAgreement = baseMapper.selectById(ptlAgreementVo.getId());
@@ -1028,25 +1029,27 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         newPtlAgreement.generateTheProtocolCode();
         save(newPtlAgreement);
         PtlAgreementAttribution ptlAgreementAttributionOld = ptlAgreementAttributionService.getById(ptlAgreementVo.getId());
-        // 复制账号配置
-        PtlAgreementAttribution ptlAgreementAttributionNew = new PtlAgreementAttribution();
-        BeanUtils.copyProperties(ptlAgreementAttributionOld, ptlAgreementAttributionNew, "id");
-        ptlAgreementAttributionNew.setId(newPtlAgreement.getId());
-        ptlAgreementAttributionService.save(ptlAgreementAttributionNew);
-        EsmInsCompany esmInsCompany = esmInsCompanyService.getById(newPtlAgreement.getInsuranceCompanyId());
-        // 添加账号配置记录
+        // 复制账号归属信息
         String batchNo = IdGenerate.nextId();
-        PtlAgreementAttributionHistory ptlAgreementAttributionHistory = new PtlAgreementAttributionHistory();
-        ptlAgreementAttributionHistory.setId(IdGenerate.nextId());
-        ptlAgreementAttributionHistory.setBatch(batchNo);
-        ptlAgreementAttributionHistory.setInsCompanyId(newPtlAgreement.getInsuranceCompanyId());
-        ptlAgreementAttributionHistory.setInsCompanyName(esmInsCompany.getName());
-        ptlAgreementAttributionHistory.setFields(ptlAgreementAttributionNew.getFields());
-        ptlAgreementAttributionHistory.setTemplateId(ptlAgreementAttributionNew.getTemplateId());
-        ptlAgreementAttributionHistory.setApiType(ptlAgreementAttributionNew.getApiType());
-        ptlAgreementAttributionHistory.setUsername(ptlAgreementAttributionNew.getUsername());
-        ptlAgreementAttributionHistory.setPassword(ptlAgreementAttributionNew.getPassword());
-        ptlAgreementAttributionHistoryService.save(ptlAgreementAttributionHistory);
+        if (ptlAgreement.getIsExternal() == 0) {
+            PtlAgreementAttribution ptlAgreementAttributionNew = new PtlAgreementAttribution();
+            BeanUtils.copyProperties(ptlAgreementAttributionOld, ptlAgreementAttributionNew, "id");
+            ptlAgreementAttributionNew.setId(newPtlAgreement.getId());
+            ptlAgreementAttributionService.save(ptlAgreementAttributionNew);
+            EsmInsCompany esmInsCompany = esmInsCompanyService.getById(newPtlAgreement.getInsuranceCompanyId());
+            // 添加账号配置记录
+            PtlAgreementAttributionHistory ptlAgreementAttributionHistory = new PtlAgreementAttributionHistory();
+            ptlAgreementAttributionHistory.setId(IdGenerate.nextId());
+            ptlAgreementAttributionHistory.setBatch(batchNo);
+            ptlAgreementAttributionHistory.setInsCompanyId(newPtlAgreement.getInsuranceCompanyId());
+            ptlAgreementAttributionHistory.setInsCompanyName(esmInsCompany.getName());
+            ptlAgreementAttributionHistory.setFields(ptlAgreementAttributionNew.getFields());
+            ptlAgreementAttributionHistory.setTemplateId(ptlAgreementAttributionNew.getTemplateId());
+            ptlAgreementAttributionHistory.setApiType(ptlAgreementAttributionNew.getApiType());
+            ptlAgreementAttributionHistory.setUsername(ptlAgreementAttributionNew.getUsername());
+            ptlAgreementAttributionHistory.setPassword(ptlAgreementAttributionNew.getPassword());
+            ptlAgreementAttributionHistoryService.save(ptlAgreementAttributionHistory);
+        }
         // 复制授权部门
         List<PtlAgreementDept> ptlAgreementDept = ptlAgreementDeptService.list(new LambdaQueryWrapper<PtlAgreementDept>().eq(PtlAgreementDept::getAgreementId, ptlAgreement.getId()));
         List<String> deptIds = ptlAgreementDept.stream().map(PtlAgreementDept::getDeptId).collect(Collectors.toList());

+ 6 - 0
src/main/resources/mapper/modules/protocols/PtlAgreementProductCostsNewMapper.xml

@@ -44,6 +44,12 @@
         <if test="params.createStartTime != null and params.createStartTime != ''">
             and DATE(papcn.create_time) BETWEEN #{params.createStartTime} and #{params.createEndTime}
         </if>
+        <if test="params.costStartDate != null and params.costStartDate != ''">
+            AND papcn.costs_start_date <![CDATA[ >= ]]> #{params.costStartDate}
+        </if>
+        <if test="params.costsEndDate != null and params.costsEndDate != ''">
+            and papcn.costs_end_date <![CDATA[ <= ]]> #{params.costsEndDate}
+        </if>
 
     </select>