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

报价费用审核 添加多个查询条件

lipf пре 1 месец
родитељ
комит
536060eaf4

+ 11 - 0
commons/src/main/java/com/jzg/commons/entity/dto/PtlAgreementCostParam.java

@@ -12,6 +12,9 @@ import java.util.List;
 public class PtlAgreementCostParam extends PageRequest {
 
 
+    @Schema(description = "审核人")
+    private String auditPerson;
+
     @Schema(description = "输入代码,名称,简称查找")
     private String agreement;
 
@@ -51,6 +54,9 @@ public class PtlAgreementCostParam extends PageRequest {
     @Schema(description = "保险公司")
     private String companyId;
 
+    @Schema(description = "保险机构合集")
+    private List<String> companyIdList;
+
     @Schema(description = "对接人")
     private String contactPerson;
 
@@ -67,4 +73,9 @@ public class PtlAgreementCostParam extends PageRequest {
     @Schema(description = "复制的新的ids")
     private List<String> newCostIds;
 
+    @Schema(description = "审核时间-起始时间")
+    private String auditTimeBegin;
+    @Schema(description = "审核时间-终止时间")
+    private String auditTimeEnd;
+
 }

+ 3 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementCostExternalServiceImpl.java

@@ -2,6 +2,7 @@ package com.jzg.organization.service.impl;
 
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.json.JSONUtil;
 import com.alibaba.nacos.common.utils.CollectionUtils;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -182,6 +183,8 @@ public class PtlAgreementCostExternalServiceImpl extends ServiceImpl<PtlAgreemen
 
     @Override
     public HttpResult pageList(CostExternalPageParam pageParam) {
+        log.info("查询外部协议费用。 pageParam=[{}]", JSONUtil.toJsonStr(pageParam));
+
         return HttpResult.ok(baseMapper.pageList(pageParam.getPage(),pageParam));
     }
 

+ 21 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementCostServiceImpl.java

@@ -25,6 +25,7 @@ import com.jzg.commons.util.BuildDescUtils;
 import com.jzg.commons.util.ListUtils;
 import com.jzg.commons.util.StringUtils;
 import com.jzg.commons.util.idgen.IdGenerate;
+import com.jzg.organization.client.EsmInsCompanyClient;
 import com.jzg.organization.mapper.PtlAgreementCostMapper;
 import com.jzg.organization.mapper.PtlAgreementCostRuleMapper;
 import com.jzg.organization.mapper.PtlAgreementCostTypeMapper;
@@ -44,6 +45,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
@@ -73,6 +75,8 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
 
     @Autowired
     private PtlAgreementCostTypeService ptlAgreementCostTypeService;
+    @Autowired
+    private EsmInsCompanyClient esmInsCompanyClient;
 
     @Autowired
     RedissonClient redissonClient;
@@ -379,6 +383,23 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
     @Override
     public HttpResult<Page<CostManagementVo>> pageList(PtlAgreementCostParam costParam) {
         log.info("查询协议费用信息:costParam=[{}]", JSONUtil.toJsonStr(costParam));
+
+        String auditTimeBegin = costParam.getAuditTimeBegin();
+        String auditTimeEnd = costParam.getAuditTimeEnd();
+        if(StrUtil.isNotEmpty(auditTimeBegin)){
+            LocalDate begin = LocalDate.parse(auditTimeBegin, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+            LocalDateTime localDateTime = begin.atStartOfDay();
+            costParam.setAuditTimeBegin(localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+        }
+        if(StrUtil.isNotEmpty(auditTimeEnd)){
+            LocalDate end = LocalDate.parse(auditTimeEnd, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
+            LocalDateTime localDateTime = end.plusDays(1).atStartOfDay();
+            costParam.setAuditTimeEnd(localDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+        }
+        if(StrUtil.isNotEmpty(costParam.getCompanyId())){
+            HttpResult<List<String>> res = esmInsCompanyClient.queryOwnAndSubCompandyIds(costParam.getCompanyId());
+            costParam.setCompanyIdList(res.getData());
+        }
         Page<CostManagementVo> costManagementVoPage = baseMapper.pageList(costParam.getPage(), costParam);
         costManagementVoPage.getRecords().forEach(item->{
             if(item.getCostRules() != null && !item.getCostRules().isEmpty()){

+ 15 - 3
tenant/organization/src/main/resources/mapper/PtlAgreementCostMapper.xml

@@ -400,6 +400,21 @@
         LEFT JOIN esm_ins_company eic on eic.id = pa.company_id  AND eic.is_delete = 0
         <where>
             pc.is_delete = 0
+            <if test="costParam.auditPerson != null and costParam.auditPerson != '' ">
+                and pc.audit_person = #{costParam.auditPerson}
+            </if>
+            <if test="costParam.auditTimeBegin != null and costParam.auditTimeBegin != ''">
+                and pc.audit_time &gt;= #{costParam.auditTimeBegin}
+            </if>
+            <if test="costParam.auditTimeEnd != null and costParam.auditTimeEnd != ''">
+                and pc.audit_time &lt; #{costParam.auditTimeEnd}
+            </if>
+            <if test="costParam.companyIdList != null and costParam.companyIdList.size() >0">
+                and pa.partner_company_id in
+                <foreach collection="costParam.companyIdList" item="partnerCompnayId" open="(" close=")" separator=",">
+                    #{partnerCompnayId}
+                </foreach>
+            </if>
             <if test="costParam.agreement != null and costParam.agreement != ''">
                 AND (pa.agreement_title  like concat('%',#{costParam.agreement},'%') or
                 pa.agreement_code  like concat('%',#{costParam.agreement},'%') or
@@ -426,9 +441,6 @@
                     AND pr_raw.rule_description LIKE concat('%',#{costParam.rulesName},'%')
                 )
             </if>
-            <if test="costParam.costRules != null and costParam.costRules != ''">
-                AND pc.cost_describe like concat('%',#{costParam.costRules},'%')
-            </if>
             <if test="costParam.costRulesList != null and costParam.costRulesList.size() > 0">
                 AND
                 <foreach collection="costParam.costRulesList" item="keyword" separator="AND">