ソースを参照

Merge remote-tracking branch 'origin/master'

Qchen 6 日 前
コミット
21b9701409

+ 3 - 0
commons/src/main/java/com/jzg/commons/entity/orders/vo/OrderListVo.java

@@ -23,6 +23,9 @@ public class OrderListVo {
     @ExcelProperty("公司名称")
     private String companyName;
 
+    @ExcelProperty("公司LOGO")
+    private String companyLogo;
+
     @ExcelProperty("报价单号")
     private String no;
     /**

+ 17 - 13
commons/src/main/java/com/jzg/commons/entity/scheme/vo/PtlSchemeSaveVo.java

@@ -286,20 +286,24 @@ public class PtlSchemeSaveVo {
     public List<PtlSchemeInsuranceDrivingIntention> getPtlSchemeInsuranceDrivingIntentionList(){
         List<PtlSchemeInsuranceDrivingIntention> ptlSchemeInsuranceDrivingIntentionList = new ArrayList<>();
         for (Scheme scheme : schemeList) {
-            // 校验同一方案内驾意险的选中类型:默认选中(1)/强制选中(2)只能出现一种且各最多一条(可选=3)
-            long defaultSelectedCount = scheme.getDrivingList().stream()
-                    .filter(drivingIntention -> "1".equals(drivingIntention.getSelectedStatus())).count();
-            long forceSelectedCount = scheme.getDrivingList().stream()
-                    .filter(drivingIntention -> "2".equals(drivingIntention.getSelectedStatus())).count();
-            if (defaultSelectedCount > 1) {
-                throw new ValidateException("方案[" + scheme.getSchemeName() + "]中默认选中的驾意险只能有一条");
-            }
-            if (forceSelectedCount > 1) {
-                throw new ValidateException("方案[" + scheme.getSchemeName() + "]中强制选中的驾意险只能有一条");
-            }
-            if (defaultSelectedCount > 0 && forceSelectedCount > 0) {
-                throw new ValidateException("方案[" + scheme.getSchemeName() + "]中默认选中与强制选中的驾意险不能同时存在");
+            // 仅自选方案(schemeType 1基础 2自选)才校验驾意险默认/强制选中,基础方案不校验
+            if ("2".equals(this.schemeType)) {
+                // 校验同一方案内驾意险的选中类型:默认选中(1)/强制选中(2)只能出现一种且各最多一条(可选=3)
+                long defaultSelectedCount = scheme.getDrivingList().stream()
+                        .filter(drivingIntention -> "1".equals(drivingIntention.getSelectedStatus())).count();
+                long forceSelectedCount = scheme.getDrivingList().stream()
+                        .filter(drivingIntention -> "2".equals(drivingIntention.getSelectedStatus())).count();
+                if (defaultSelectedCount > 1) {
+                    throw new ValidateException("方案[" + scheme.getSchemeName() + "]中默认选中的驾意险只能有一条");
+                }
+                if (forceSelectedCount > 1) {
+                    throw new ValidateException("方案[" + scheme.getSchemeName() + "]中强制选中的驾意险只能有一条");
+                }
+                if (defaultSelectedCount > 0 && forceSelectedCount > 0) {
+                    throw new ValidateException("方案[" + scheme.getSchemeName() + "]中默认选中与强制选中的驾意险不能同时存在");
+                }
             }
+
             scheme.getDrivingList().forEach(drivingIntention -> {
                 PtlSchemeInsuranceDrivingIntention ptlSchemeInsuranceDrivingIntention = new PtlSchemeInsuranceDrivingIntention();
                 ptlSchemeInsuranceDrivingIntention.setId(IdGenerate.nextId());

+ 6 - 0
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsOrdersServiceImpl.java

@@ -162,6 +162,9 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
     @Autowired
     private ExportBaseServiceImpl exportBaseService;
 
+    @Value("${minio.url}")
+    private String url;
+
     @Value("${minio.bucket-name}")
     private String bucketName;
 
@@ -1130,6 +1133,9 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
             long offset = (current - 1) * size;
             long total = insOrdersMapper.countOrderListDistinct(insOrdersParam);
             List<OrderListVo> records = insOrdersMapper.queryOrderListDistinct(insOrdersParam, offset, size);
+            records.stream().forEach(record -> {
+                record.setCompanyLogo(record.getCompanyLogo() != null ? url + "/" + bucketName + "/" + record.getCompanyLogo() : null);
+            });
             // 大订单:以主订单为主,查询主订单下的从订单并挂载
             if (StringUtils.equals("1", insOrdersParam.getIsLargeOrder()) && CollUtil.isNotEmpty(records)) {
                 List<String> parentIds = records.stream().map(OrderListVo::getOrderNo).collect(Collectors.toList());

+ 11 - 8
tenant/insurance/quotation-summary/src/main/java/com/jzg/quotation/summary/service/impl/InsTaskImagesServiceImpl.java

@@ -19,6 +19,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
 
 @Service
 public class  InsTaskImagesServiceImpl extends ServiceImpl<InsTaskImagesMapper, InsTaskImages> implements InsTaskImagesService {
@@ -64,14 +65,16 @@ public class  InsTaskImagesServiceImpl extends ServiceImpl<InsTaskImagesMapper,
         int delete = baseMapper.delete(new LambdaUpdateWrapper<InsTaskImages>()
                 .eq(InsTaskImages::getQuoteNo, quoteNo));
         insuranceUploadImageVo.getImageVoList().forEach(imageVo -> {
-            imageVo.getImageBase64List().forEach(base64 ->{
-                InsTaskImages insTaskImages = new InsTaskImages();
-                insTaskImages.setId(IdGenerate.nextId());
-                insTaskImages.setQuoteNo(quoteNo);
-                insTaskImages.setImageType(imageVo.getImageCode());
-                insTaskImages.setImageId(base64.getImageId());
-                images.add(insTaskImages);
-            });
+            if(Objects.nonNull(imageVo.getImageBase64List())) {
+                imageVo.getImageBase64List().forEach(base64 -> {
+                    InsTaskImages insTaskImages = new InsTaskImages();
+                    insTaskImages.setId(IdGenerate.nextId());
+                    insTaskImages.setQuoteNo(quoteNo);
+                    insTaskImages.setImageType(imageVo.getImageCode());
+                    insTaskImages.setImageId(base64.getImageId());
+                    images.add(insTaskImages);
+                });
+            }
         });
         return !baseMapper.insert(images).isEmpty();
     }

+ 10 - 7
tenant/insurance/quotation-summary/src/main/resources/mapper/InsOrdersMapper.xml

@@ -1372,11 +1372,12 @@
 
     <!-- 手动分页版:按车牌+状态分组去重(每组取最新一条),返回当前页数据;不触发 MP 自动 count -->
     <select id="queryOrderListDistinct" resultType="com.jzg.commons.entity.orders.vo.OrderListVo">
-        SELECT
+        select * from (SELECT
         io.id as order_no,
         io.quote_no as no,
         io.company_id,
         io.company_name,
+        eicLogo.file_name as companyLogo,
         io.product_id as productCode,
         io.product_name as productName,
         io.order_status,
@@ -1407,15 +1408,15 @@
         io.pay_link as paymentLink,
         ioa.status as adjustStatus,
         ioa.id as adjustId,
-        ioa1.after_premium as adjustPremium
+        ioa1.after_premium as adjustPremium,
+        ROW_NUMBER() OVER(PARTITION BY COALESCE(ioci.license_no, io.id), io.order_status ORDER BY io.create_time DESC)
+        AS rn
         FROM (
         SELECT dedup.order_id
         FROM (
         SELECT
         io.id AS order_id,
-        io.create_time,
-        ROW_NUMBER() OVER(PARTITION BY COALESCE(ioci.license_no, io.id), io.order_status ORDER BY io.create_time DESC)
-        AS rn
+        io.create_time
         FROM
         ins_orders io
         LEFT JOIN ins_orders_car_info ioci ON ioci.order_no = io.id and ioci.is_delete = 0
@@ -1583,11 +1584,12 @@
             </if>
         </where>
         ) dedup
-        WHERE dedup.rn = 1
         ORDER BY dedup.create_time DESC
         LIMIT #{offset}, #{size}
         ) p
         JOIN ins_orders io ON io.id = p.order_id
+        LEFT JOIN esm_ins_company eic on io.company_id = eic.id and eic.is_delete = 0
+        LEFT JOIN sys_upload_files eicLogo on eic.logo = eicLogo.id and eicLogo.is_delete = 0
         LEFT JOIN ins_orders_car_info ioci ON ioci.order_no = io.id and ioci.is_delete = 0
         LEFT JOIN
         ins_orders_car_user_info owner_u on owner_u.order_no = io.id and owner_u.policy_person_type = 1 and
@@ -1633,7 +1635,8 @@
         FROM ins_order_adjust t where t.status = 2 and t.is_delete = 0
         ) x WHERE x.rn = 1
         ) ioa1 ON io.id = ioa1.order_no
-        order by io.create_time desc
+        order by io.create_time desc) tt
+        where tt.rn = 1
     </select>
 
     <!-- 手动分页版:统计按车牌+状态分组去重后的总条数 -->

+ 34 - 1
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementCostServiceImpl.java

@@ -6,11 +6,13 @@ import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.ReUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONUtil;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.jzg.commons.constants.Constants;
+import com.jzg.commons.constants.Crud;
 import com.jzg.commons.constants.ReturnInformation;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.base.StateResult;
@@ -22,8 +24,10 @@ import com.jzg.commons.entity.vo.CostsListVo;
 import com.jzg.commons.entity.vo.PtlAgreementCostRuleVo;
 import com.jzg.commons.entity.vo.PtlAgreementCostVo;
 import com.jzg.commons.exception.SystemException;
+import com.jzg.commons.service.OperatorTrajectoryService;
 import com.jzg.commons.util.ListUtils;
 import com.jzg.commons.util.StringUtils;
+import com.jzg.commons.util.comparble.CompatibleUtils;
 import com.jzg.commons.util.idgen.IdGenerate;
 import com.jzg.organization.client.EsmInsCompanyClient;
 import com.jzg.organization.component.BuildDescUtils;
@@ -99,6 +103,8 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
     private SysUserJzgInfoService sysUserJzgInfoService;
     @Autowired
     private PtlAreaLicenseService ptlAreaLicenseService;
+    @Autowired
+    private OperatorTrajectoryService operatorTrajectoryService;
 
     /**
      * 报价配置/费用管理/新增费用
@@ -665,6 +671,9 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
             return HttpResult.error("未找到需要调整的费用类型记录");
         }
 
+        // 备份调整前的数据 用于操作轨迹 beforeJson
+        List<PtlAgreementCostType> beforeCostTypeList = BeanUtil.copyToList(costTypeList, PtlAgreementCostType.class);
+
         boolean isAdd = "ADD".equalsIgnoreCase(param.getOperationType());
 
         // 校验:至少传递一种险种的比例
@@ -706,7 +715,31 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
 
         // 批量更新
         ptlAgreementCostTypeService.updateBatchById(costTypeList);
-
+        // 插入操作轨迹表记录
+        OperatorTrajectory operatorTrajectory = new OperatorTrajectory();
+        operatorTrajectory.setId(IdGenerate.nextId());
+        operatorTrajectory.setModuleName("报价配置/费用管理/批量调整费用比例");
+        operatorTrajectory.setServiceTag(
+                "com.jzg.organization.service.impl.PtlAgreementCostServiceImpl.batchAdjustCostRatio()");
+        operatorTrajectory.setEntityName(
+                "com.jzg.commons.entity.po.PtlAgreementCostType");
+        operatorTrajectory.setPrimaryValue(String.join(",", param.getCostIds()));
+        operatorTrajectory.setOperatorType(Crud.U.getCode());
+        Map<String, Object> beforeWrapper = new HashMap<>();
+        beforeWrapper.put("costTypeList", beforeCostTypeList);
+        operatorTrajectory.setBeforeJson(JSONUtil.toJsonStr(beforeWrapper));
+
+        Map<String, Object> afterWrapper = new HashMap<>();
+        afterWrapper.put("costTypeList", costTypeList);
+        operatorTrajectory.setAfterJson(JSONUtil.toJsonStr(afterWrapper));
+        operatorTrajectory.setOperationContent("批量调整费用比例");
+        operatorTrajectory.setSystemCode(baseController.getSystemCode());
+        String userTokenString = baseController.getUserTokenString();
+        JSONObject userInfo = JSONObject.parseObject(userTokenString);
+        operatorTrajectory.setCreateBy(userInfo.getString("username"));
+        operatorTrajectory.setCreateByName(userInfo.getString("name"));
+        operatorTrajectory.setCreateTime(LocalDateTime.now());
+        operatorTrajectoryService.save(operatorTrajectory);
         return HttpResult.ok("批量调整成功,共调整 " + adjustedCount + " 条记录");
     }