Przeglądaj źródła

添加维护人

wks 1 rok temu
rodzic
commit
d78a99d9a6

+ 13 - 0
sql/Online.sql

@@ -0,0 +1,13 @@
+# 子订单
+alter table ins_area_company
+    add leader_id varchar(64) null comment '维护人工号';
+alter table ins_area_company
+    add leader_name varchar(64) null comment '维护人';
+
+# 应收表
+alter table ins_ply_income
+    add leader_id varchar(64) null comment '维护人工号';
+alter table ins_ply_income
+    add leader_id varchar(64) null comment '维护人';
+
+# 历史收入表

+ 12 - 0
src/main/java/com/ydtech/modules/fnc/entity/InsPlyIncome.java

@@ -480,6 +480,18 @@ public class InsPlyIncome implements Serializable {
     @TableField("add_type")
     @TableField("add_type")
     private String addType;
     private String addType;
 
 
+    /**
+     * 维护人id
+     */
+    @TableField(value = "leader_id")
+    private String leaderId;
+
+    /**
+     * 维护人名称
+     */
+    @TableField(value = "leader_name")
+    private String leaderName;
+
 
 
     public InsPlyIncome(String orderno, String policyno, String syPolicyno, String noPolicyno, String settleno, String deptId, String deptName, String riskcode, LocalDateTime payDate, LocalDateTime signDate, String companyId, String companyName, String agreementId, String licenseno, BigDecimal taxamount, BigDecimal noTaxPremium, BigDecimal commissionFeerate, BigDecimal otherFeerate, BigDecimal commissionFeevalue, BigDecimal otherFeevalue, BigDecimal allFeeValue, BigDecimal finalFeeValue, BigDecimal doingFeeValue, LocalDateTime createTime, String voucherNumber, String contractId, String contractFileId, String handlingFeesStatus, String documentaryFeesStatus, String isNotCar, String isNotDocumentary) {
     public InsPlyIncome(String orderno, String policyno, String syPolicyno, String noPolicyno, String settleno, String deptId, String deptName, String riskcode, LocalDateTime payDate, LocalDateTime signDate, String companyId, String companyName, String agreementId, String licenseno, BigDecimal taxamount, BigDecimal noTaxPremium, BigDecimal commissionFeerate, BigDecimal otherFeerate, BigDecimal commissionFeevalue, BigDecimal otherFeevalue, BigDecimal allFeeValue, BigDecimal finalFeeValue, BigDecimal doingFeeValue, LocalDateTime createTime, String voucherNumber, String contractId, String contractFileId, String handlingFeesStatus, String documentaryFeesStatus, String isNotCar, String isNotDocumentary) {
         this.orderno = orderno;
         this.orderno = orderno;

+ 70 - 56
src/main/java/com/ydtech/modules/fnc/service/InsPlyIncomeService.java

@@ -52,7 +52,16 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
     HttpResult<BasePageResult<InsPlyIncome>> nonSettlementQuery(InsPlyIncomeVo insPlyIncomeVo);
     HttpResult<BasePageResult<InsPlyIncome>> nonSettlementQuery(InsPlyIncomeVo insPlyIncomeVo);
 
 
 
 
-    void saveBalanceNew(InsOrders order, InsFeeOrderNew insFeeOrderNew, InsAreaCompany insAreaCompany);
+    /**
+     * 保司结算 手续费 跟单单
+     *
+     * @param order          订单数据
+     * @param insFeeOrderNew 费用数据
+     * @param insAreaCompany 子订单
+     * @param leaderId       维护人id
+     * @param leaderName     维护人姓名
+     */
+    void saveBalanceNew(InsOrders order, InsFeeOrderNew insFeeOrderNew, InsAreaCompany insAreaCompany, String leaderId, String leaderName);
 
 
     HttpResult<List<InsPlyIncome>> nonSettldetail(InsPlyIncomeVo insPlyIncomeVo);
     HttpResult<List<InsPlyIncome>> nonSettldetail(InsPlyIncomeVo insPlyIncomeVo);
 
 
@@ -66,7 +75,7 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
 
 
     HttpResult<InsPlyIncome> insertByEntity(InsPlyIncomeVo insPlyIncomeVo);
     HttpResult<InsPlyIncome> insertByEntity(InsPlyIncomeVo insPlyIncomeVo);
 
 
-    HashMap<String,Object> totalAmount(List<String> selectIds);
+    HashMap<String, Object> totalAmount(List<String> selectIds);
 
 
     HttpResult<Object> batchPinBalance(InsPlyIncomeVo insPlyIncomeVo);
     HttpResult<Object> batchPinBalance(InsPlyIncomeVo insPlyIncomeVo);
 
 
@@ -95,17 +104,15 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
     InsPlyIncome bxTotalAmount(InsPlyIncomeVo insPlyIncomeVo);
     InsPlyIncome bxTotalAmount(InsPlyIncomeVo insPlyIncomeVo);
 
 
     /**
     /**
-     *
      * @param multipartFile
      * @param multipartFile
-     * @param isNotCar    是否是非车
-     * @return  返回总金额 以及未匹配的数据
+     * @param isNotCar      是否是非车
+     * @return 返回总金额 以及未匹配的数据
      */
      */
-    HashMap<String, Object> bxImportData(MultipartFile multipartFile ,String isNotCar);
+    HashMap<String, Object> bxImportData(MultipartFile multipartFile, String isNotCar);
 
 
-    HashMap<String, Object> bxImportNoData(MultipartFile multipartFile,String isNotCar);
+    HashMap<String, Object> bxImportNoData(MultipartFile multipartFile, String isNotCar);
 
 
     /**
     /**
-     *
      * @param insPlyIncomeVo 参数对象
      * @param insPlyIncomeVo 参数对象
      * @param request
      * @param request
      * @param response
      * @param response
@@ -114,30 +121,28 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
     HttpResult bxOtherDetailsExcel(InsPlyIncomeVo insPlyIncomeVo, HttpServletRequest request, HttpServletResponse response);
     HttpResult bxOtherDetailsExcel(InsPlyIncomeVo insPlyIncomeVo, HttpServletRequest request, HttpServletResponse response);
 
 
     /**
     /**
-     *
-     * @param insPlyIncomeVo  传参字段
-     * @return  开票未结算金额  开票号   ids  开票时间
+     * @param insPlyIncomeVo 传参字段
+     * @return 开票未结算金额  开票号   ids  开票时间
      */
      */
     HttpResult<List<SettlementDocumentaryFeesEntity>> invicdetail(InsPlyIncomeVo insPlyIncomeVo);
     HttpResult<List<SettlementDocumentaryFeesEntity>> invicdetail(InsPlyIncomeVo insPlyIncomeVo);
 
 
     HttpResult bxNoOtherDetailsExcel(InsPlyIncomeVo insPlyIncomeVo, HttpServletRequest request, HttpServletResponse response);
     HttpResult bxNoOtherDetailsExcel(InsPlyIncomeVo insPlyIncomeVo, HttpServletRequest request, HttpServletResponse response);
 
 
     /**
     /**
-     *
-     * @param incomeIds  开票ids
-     * @return  通过开票id分组查出的金额总和
+     * @param incomeIds 开票ids
+     * @return 通过开票id分组查出的金额总和
      */
      */
-    HttpResult<List<HashMap<String,Object>>> otherSettldetail(InsPlyIncomeVo insPlyIncomeVo);
+    HttpResult<List<HashMap<String, Object>>> otherSettldetail(InsPlyIncomeVo insPlyIncomeVo);
 
 
     InsPlyIncome getEntityById(String id);
     InsPlyIncome getEntityById(String id);
 
 
-    HttpResult<List<HashMap<String,Object>>> otherTimeDetail(InsPlyIncomeVo insPlyIncomeVo);
+    HttpResult<List<HashMap<String, Object>>> otherTimeDetail(InsPlyIncomeVo insPlyIncomeVo);
 
 
     HttpResult<Object> singleInvoic(InsPlyIncomeVo insPlyIncomeVo);
     HttpResult<Object> singleInvoic(InsPlyIncomeVo insPlyIncomeVo);
 
 
     void batchUpdate(InsPlyIncomeVo insPlyIncomeVo);
     void batchUpdate(InsPlyIncomeVo insPlyIncomeVo);
 
 
-    HashMap<String, Object> bxImportOther(MultipartFile multipartFile,String isNotCar);
+    HashMap<String, Object> bxImportOther(MultipartFile multipartFile, String isNotCar);
 
 
     InsPlyIncome ptTotalAmount(InsPlyIncomeVo insPlyIncomeVo);
     InsPlyIncome ptTotalAmount(InsPlyIncomeVo insPlyIncomeVo);
 
 
@@ -148,36 +153,39 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
     HttpResult<Object> reconciliation(InsPlyIncomeVo insPlyIncomeVo);
     HttpResult<Object> reconciliation(InsPlyIncomeVo insPlyIncomeVo);
 
 
     HttpResult<Object> batchSumBalance(InsPlyIncomeVo insPlyIncomeVo);
     HttpResult<Object> batchSumBalance(InsPlyIncomeVo insPlyIncomeVo);
+
     /**
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/6/18 10:10
-     *  @Description:  查询平台已结算记录
+     * @version
+     * @author: hxl
+     * @Date: 2024/6/18 10:10
+     * @Description: 查询平台已结算记录
      */
      */
     List<PlatformSettlementRecordDto> platformSettlementRecord(InsPlyIncomeVo insPlyIncomeV);
     List<PlatformSettlementRecordDto> platformSettlementRecord(InsPlyIncomeVo insPlyIncomeV);
 
 
     /**
     /**
      * @param insPlyIncomeVo
      * @param insPlyIncomeVo
-     * @Description:  平台新增
-     * @return   InsPlyIncome
+     * @return InsPlyIncome
+     * @Description: 平台新增
      */
      */
     HttpResult<InsPlyIncome> ptInsert(InsPlyIncomeVo insPlyIncomeVo);
     HttpResult<InsPlyIncome> ptInsert(InsPlyIncomeVo insPlyIncomeVo);
 
 
     void updateNoHand(InsPlyIncomeVo insPlyIncomeVo);
     void updateNoHand(InsPlyIncomeVo insPlyIncomeVo);
 
 
     HttpResult<Object> batchPinBalanceNew(InsPlyIncomeVo insPlyIncomeVo);
     HttpResult<Object> batchPinBalanceNew(InsPlyIncomeVo insPlyIncomeVo);
+
     /***
     /***
      *
      *
      * @param insPlyIncomeVo
      * @param insPlyIncomeVo
-     * @return  返回私有 平台  应收 已收  未收
+     * @return 返回私有 平台  应收 已收  未收
      */
      */
-    HttpResult<ArrayList<Map<String,Object>>> totalReceivables(InsPlyIncomeVo insPlyIncomeVo);
+    HttpResult<ArrayList<Map<String, Object>>> totalReceivables(InsPlyIncomeVo insPlyIncomeVo);
 
 
-    HttpResult<List<HashMap<String,Object>>> monthTotalReceivables(InsPlyIncomeVo insPlyIncomeVo);
+    HttpResult<List<HashMap<String, Object>>> monthTotalReceivables(InsPlyIncomeVo insPlyIncomeVo);
 
 
     /**
     /**
-     *      平台批量修改比例
-     * @param multipartFile  文件
+     * 平台批量修改比例
+     *
+     * @param multipartFile 文件
      * @return
      * @return
      */
      */
     HashMap<String, Object> ptImportOther(MultipartFile multipartFile);
     HashMap<String, Object> ptImportOther(MultipartFile multipartFile);
@@ -185,56 +193,62 @@ public interface InsPlyIncomeService extends IService<InsPlyIncome> {
     void bxImportOtherConfirm(InsPlyIncomeVo insPlyIncomeVo);
     void bxImportOtherConfirm(InsPlyIncomeVo insPlyIncomeVo);
 
 
     void noBxImportOtherConfirm(InsPlyIncomeVo insPlyIncomeVo);
     void noBxImportOtherConfirm(InsPlyIncomeVo insPlyIncomeVo);
+
     /**
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/8/1 9:27
-     *  @Description:  获取平台、私有协议数据
+     * @version
+     * @author: hxl
+     * @Date: 2024/8/1 9:27
+     * @Description: 获取平台、私有协议数据
      */
      */
     FinancialReceivablesAllVo queryDateByType(FinancialReceivablesQueryVo financialReceivablesQueryVo);
     FinancialReceivablesAllVo queryDateByType(FinancialReceivablesQueryVo financialReceivablesQueryVo);
+
     /**
     /**
-     *  @version 
-     *  @author: hxl
-     *  @Date: 2024/8/5 9:43
-     *  @Description:
+     * @version
+     * @author: hxl
+     * @Date: 2024/8/5 9:43
+     * @Description:
      */
      */
     FinancialReceivablesAllMonthVo queryDateByTypeByMonth(FinancialReceivablesQueryMonthVo financialReceivablesQueryVo);
     FinancialReceivablesAllMonthVo queryDateByTypeByMonth(FinancialReceivablesQueryMonthVo financialReceivablesQueryVo);
+
     /**
     /**
-     *  @version
-     *  @author: whp
-     *  @Date: 2024/8/7 9:20
-     *  @Description:  私有 车险
+     * @version
+     * @author: whp
+     * @Date: 2024/8/7 9:20
+     * @Description: 私有 车险
      */
      */
     FinancialReceivablesAllVo queryPrivateCar(FinancialReceivablesQueryVo financialReceivablesQueryVo);
     FinancialReceivablesAllVo queryPrivateCar(FinancialReceivablesQueryVo financialReceivablesQueryVo);
 
 
     /**
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/8/7 11:20
-     *  @Description: 添加修正协议修改类型重新生成数据的逻辑
+     * @version
+     * @author: hxl
+     * @Date: 2024/8/7 11:20
+     * @Description: 添加修正协议修改类型重新生成数据的逻辑
      */
      */
     HttpResult<List<InsPlyIncome>> createData(InsPlyIncomeIdsVo insPlyIncomeIdsVo);
     HttpResult<List<InsPlyIncome>> createData(InsPlyIncomeIdsVo insPlyIncomeIdsVo);
 
 
     List<InsuranceHandlingSettlementMonthDto> getInvociAmount(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
     List<InsuranceHandlingSettlementMonthDto> getInvociAmount(InsuranceHandlingSettlementMonthVo insuranceHandlingSettlementMonthVo);
+
     /**
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/9/20 9:57
-     *  @Description:  平台结算情况统计
+     * @version
+     * @author: hxl
+     * @Date: 2024/9/20 9:57
+     * @Description: 平台结算情况统计
      */
      */
     List<InsPlyIncomePTDto> totalPTAmount(InsPlyIncomePTVo insPlyIncomeVo);
     List<InsPlyIncomePTDto> totalPTAmount(InsPlyIncomePTVo insPlyIncomeVo);
+
     /**
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/9/20 11:00
-     *  @Description: 通过对接人查询结算数据
+     * @version
+     * @author: hxl
+     * @Date: 2024/9/20 11:00
+     * @Description: 通过对接人查询结算数据
      */
      */
     List<InsPlyIncomePTCompanyDto> findListByDockingPerson(InsPlyIncomeQueryPTVo insPlyIncomeVo);
     List<InsPlyIncomePTCompanyDto> findListByDockingPerson(InsPlyIncomeQueryPTVo insPlyIncomeVo);
+
     /**
     /**
-     *  @version
-     *  @author: hxl
-     *  @Date: 2024/9/21 14:13
-     *  @Description:  导出数据
+     * @version
+     * @author: hxl
+     * @Date: 2024/9/21 14:13
+     * @Description: 导出数据
      */
      */
     void importDataAddType(MultipartFile file, String type) throws Exception;
     void importDataAddType(MultipartFile file, String type) throws Exception;
 }
 }

+ 1 - 1
src/main/java/com/ydtech/modules/fnc/service/impl/InsFeeAuditServiceImpl.java

@@ -169,7 +169,7 @@ public class InsFeeAuditServiceImpl extends ServiceImpl<InsFeeAuditMapper, InsFe
             //生成机构费用
             //生成机构费用
             gene_deptfee(order, insFeeOrderNew, insAreaCompany);
             gene_deptfee(order, insFeeOrderNew, insAreaCompany);
             //结算费用生成
             //结算费用生成
-            insPlyIncomeService.saveBalanceNew(order, insFeeOrderNew, insAreaCompany);
+            insPlyIncomeService.saveBalanceNew(order, insFeeOrderNew, insAreaCompany, user.getLeaderId(), user.getLeaderName());
 
 
             //生成  用户账户表  数据
             //生成  用户账户表  数据
             if (StringUtils.isNotEmpty(order.getUserid())) {
             if (StringUtils.isNotEmpty(order.getUserid())) {

+ 28 - 12
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -16,7 +16,9 @@ import com.ydtech.constants.enums.dict.agreement.ProductsType;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.model.SysDept;
 import com.ydtech.modules.admin.model.SysDept;
+import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.model.report.financialReceivables.*;
 import com.ydtech.modules.admin.model.report.financialReceivables.*;
+import com.ydtech.modules.admin.service.SysUserService;
 import com.ydtech.modules.admin.utils.SliceUpDateUtil;
 import com.ydtech.modules.admin.utils.SliceUpDateUtil;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.esm.model.EsmInsCompany;
 import com.ydtech.modules.esm.model.EsmInsCompany;
@@ -104,8 +106,9 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
     @Autowired
     @Autowired
     @Lazy
     @Lazy
     private InsOrdersService insOrdersService;
     private InsOrdersService insOrdersService;
+
     @Autowired
     @Autowired
-    private InsAreaCompanyService insAreaCompanyService;
+    private SysUserService sysUserService;
 
 
     @Autowired
     @Autowired
     private InsFeeOrderNewService insFeeOrderNewService;
     private InsFeeOrderNewService insFeeOrderNewService;
@@ -156,7 +159,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
     }
     }
 
 
     @Override
     @Override
-    public void saveBalanceNew(InsOrders order, InsFeeOrderNew insFeeOrderNew, InsAreaCompany insAreaCompany) {
+    public void saveBalanceNew(InsOrders order, InsFeeOrderNew insFeeOrderNew, InsAreaCompany insAreaCompany, String leaderId, String leaderName) {
         if (ObjectUtils.isEmpty(order) || ObjectUtils.isEmpty(insFeeOrderNew) || ObjectUtils.isEmpty(insAreaCompany)) {
         if (ObjectUtils.isEmpty(order) || ObjectUtils.isEmpty(insFeeOrderNew) || ObjectUtils.isEmpty(insAreaCompany)) {
             return;
             return;
         }
         }
@@ -168,22 +171,22 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                 this.savePinTai(order, insFeeOrderNew, insAreaCompany);  //手续费不分非车不非车 跟单也不分
                 this.savePinTai(order, insFeeOrderNew, insAreaCompany);  //手续费不分非车不非车 跟单也不分
             } else {  // 保险  逻辑: 手续费生成一条  跟单费生成一条   非车手续费一条  非车跟单费一条
             } else {  // 保险  逻辑: 手续费生成一条  跟单费生成一条   非车手续费一条  非车跟单费一条
                 if (((insFeeOrderNew.getJqSuperviseCostsPremiums() != null && insFeeOrderNew.getJqSuperviseCostsPremiums().compareTo(BigDecimal.ZERO) != 0)) || (insFeeOrderNew.getSySuperviseCostsPremiums() != null && insFeeOrderNew.getSySuperviseCostsPremiums().compareTo(BigDecimal.ZERO) != 0)) { //手续费
                 if (((insFeeOrderNew.getJqSuperviseCostsPremiums() != null && insFeeOrderNew.getJqSuperviseCostsPremiums().compareTo(BigDecimal.ZERO) != 0)) || (insFeeOrderNew.getSySuperviseCostsPremiums() != null && insFeeOrderNew.getSySuperviseCostsPremiums().compareTo(BigDecimal.ZERO) != 0)) { //手续费
-                    this.saveInsuranceProcedures(order, insFeeOrderNew, insAreaCompany);
+                    this.saveInsuranceProcedures(order, insFeeOrderNew, insAreaCompany, leaderId, leaderName);
                 }
                 }
                 if (insFeeOrderNew.getJqOtherCostsPremiums() != null && insFeeOrderNew.getJqOtherCostsPremiums().compareTo(BigDecimal.ZERO) != 0) {   //跟单费
                 if (insFeeOrderNew.getJqOtherCostsPremiums() != null && insFeeOrderNew.getJqOtherCostsPremiums().compareTo(BigDecimal.ZERO) != 0) {   //跟单费
-                    this.saveOtherAmount(order, insFeeOrderNew, insAreaCompany);
+                    this.saveOtherAmount(order, insFeeOrderNew, insAreaCompany, leaderId, leaderName);
                 }
                 }
                 if (insFeeOrderNew.getNoSuperviseCostsPremiums() != null && insFeeOrderNew.getNoSuperviseCostsPremiums().compareTo(BigDecimal.ZERO) != 0) {  // 非车手续费
                 if (insFeeOrderNew.getNoSuperviseCostsPremiums() != null && insFeeOrderNew.getNoSuperviseCostsPremiums().compareTo(BigDecimal.ZERO) != 0) {  // 非车手续费
-                    this.saveNoSupervise(order, insFeeOrderNew, insAreaCompany);
+                    this.saveNoSupervise(order, insFeeOrderNew, insAreaCompany, leaderId, leaderName);
                 }
                 }
                 if (insFeeOrderNew.getNoOtherCostsPremiums() != null && insFeeOrderNew.getNoOtherCostsPremiums().compareTo(BigDecimal.ZERO) != 0) {  // 非车跟单费
                 if (insFeeOrderNew.getNoOtherCostsPremiums() != null && insFeeOrderNew.getNoOtherCostsPremiums().compareTo(BigDecimal.ZERO) != 0) {  // 非车跟单费
-                    this.saveNoOtherAmount(order, insFeeOrderNew, insAreaCompany);
+                    this.saveNoOtherAmount(order, insFeeOrderNew, insAreaCompany, leaderId, leaderName);
                 }
                 }
             }
             }
         }
         }
     }
     }
 
 
-    private void saveNoOtherAmount(InsOrders order, InsFeeOrderNew insFeeOrderNew, InsAreaCompany insAreaCompany) {
+    private void saveNoOtherAmount(InsOrders order, InsFeeOrderNew insFeeOrderNew, InsAreaCompany insAreaCompany,  String leaderId, String leaderName) {
         InsPlyIncome insPlyIncome = new InsPlyIncome();
         InsPlyIncome insPlyIncome = new InsPlyIncome();
         insPlyIncome.setOrderno(insFeeOrderNew.getInsOrderNo());  // 子订单号
         insPlyIncome.setOrderno(insFeeOrderNew.getInsOrderNo());  // 子订单号
         String noPolicyno = this.setNoPolicyno(insAreaCompany);
         String noPolicyno = this.setNoPolicyno(insAreaCompany);
@@ -218,7 +221,11 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setAllFeeValue(insFeeOrderNew.getNoOtherCostsPremiums());
         insPlyIncome.setAllFeeValue(insFeeOrderNew.getNoOtherCostsPremiums());
         insPlyIncome.setNoOtherCostsPremium(insFeeOrderNew.getNoOtherCostsPremiums());
         insPlyIncome.setNoOtherCostsPremium(insFeeOrderNew.getNoOtherCostsPremiums());
         insPlyIncome.setNoOtherCostsProportion(insFeeOrderNew.getNoOtherCostsProportion());
         insPlyIncome.setNoOtherCostsProportion(insFeeOrderNew.getNoOtherCostsProportion());
+        // 维护人
+        insPlyIncome.setLeaderId(leaderId);
+        insPlyIncome.setLeaderName(leaderName);
         this.saveByCompanyId(insFeeOrderNew, insAreaCompany.getCompanyId(), insPlyIncome);
         this.saveByCompanyId(insFeeOrderNew, insAreaCompany.getCompanyId(), insPlyIncome);
+
         this.getDeptId(insPlyIncome);
         this.getDeptId(insPlyIncome);
         baseMapper.insert(insPlyIncome);
         baseMapper.insert(insPlyIncome);
 
 
@@ -230,7 +237,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncomeLogService.saveLog(insPlyIncomeLog);  //添加日志
         insPlyIncomeLogService.saveLog(insPlyIncomeLog);  //添加日志
     }
     }
 
 
-    private void saveNoSupervise(InsOrders order, InsFeeOrderNew insFeeOrderNew, InsAreaCompany insAreaCompany) {
+    private void saveNoSupervise(InsOrders order, InsFeeOrderNew insFeeOrderNew, InsAreaCompany insAreaCompany,  String leaderId, String leaderName) {
         InsPlyIncome insPlyIncome = new InsPlyIncome();
         InsPlyIncome insPlyIncome = new InsPlyIncome();
         insPlyIncome.setOrderno(insFeeOrderNew.getInsOrderNo());  // 子订单号
         insPlyIncome.setOrderno(insFeeOrderNew.getInsOrderNo());  // 子订单号
         insPlyIncome.setCommissionFeevalue(insFeeOrderNew.getNoSuperviseCostsPremiums());// 非车手续费
         insPlyIncome.setCommissionFeevalue(insFeeOrderNew.getNoSuperviseCostsPremiums());// 非车手续费
@@ -265,6 +272,9 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setSyEndDate(StringOperations.emptyStringToNull(insAreaCompany.getSyEndDate()));
         insPlyIncome.setSyEndDate(StringOperations.emptyStringToNull(insAreaCompany.getSyEndDate()));
         insPlyIncome.setNoSuperviseCostsPremiums(insFeeOrderNew.getNoSuperviseCostsPremiums());
         insPlyIncome.setNoSuperviseCostsPremiums(insFeeOrderNew.getNoSuperviseCostsPremiums());
         insPlyIncome.setNoSuperviseCostsProportion(insFeeOrderNew.getNoSuperviseCostsProportion());
         insPlyIncome.setNoSuperviseCostsProportion(insFeeOrderNew.getNoSuperviseCostsProportion());
+        // 维护人
+        insPlyIncome.setLeaderId(leaderId);
+        insPlyIncome.setLeaderName(leaderName);
         this.getDeptId(insPlyIncome);
         this.getDeptId(insPlyIncome);
         this.saveByCompanyId(insFeeOrderNew, insAreaCompany.getCompanyId(), insPlyIncome);
         this.saveByCompanyId(insFeeOrderNew, insAreaCompany.getCompanyId(), insPlyIncome);
         insPlyIncome.setReceivableAmount(insFeeOrderNew.getNoSuperviseCostsPremiums());
         insPlyIncome.setReceivableAmount(insFeeOrderNew.getNoSuperviseCostsPremiums());
@@ -297,7 +307,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
 
 
     }
     }
 
 
-    private void saveOtherAmount(InsOrders order, InsFeeOrderNew insFeeOrderNew, InsAreaCompany insAreaCompany) {
+    private void saveOtherAmount(InsOrders order, InsFeeOrderNew insFeeOrderNew, InsAreaCompany insAreaCompany,  String leaderId, String leaderName) {
         BigDecimal otherAmount = this.calculateTotal(insFeeOrderNew.getJqOtherCostsPremiums(), insFeeOrderNew.getSyOtherCostsPremiums(),
         BigDecimal otherAmount = this.calculateTotal(insFeeOrderNew.getJqOtherCostsPremiums(), insFeeOrderNew.getSyOtherCostsPremiums(),
                 null);
                 null);
         BigDecimal otherProportion = this.calculateTotal(insFeeOrderNew.getSyOtherCostsProportion(),
         BigDecimal otherProportion = this.calculateTotal(insFeeOrderNew.getSyOtherCostsProportion(),
@@ -332,6 +342,9 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setUserId(insFeeOrderNew.getUserId());
         insPlyIncome.setUserId(insFeeOrderNew.getUserId());
         insPlyIncome.setInsuredName(order.getInsuredname());
         insPlyIncome.setInsuredName(order.getInsuredname());
         insPlyIncome.setReceivableAmount(otherAmount);
         insPlyIncome.setReceivableAmount(otherAmount);
+        // 维护人
+        insPlyIncome.setLeaderId(leaderId);
+        insPlyIncome.setLeaderName(leaderName);
         this.getDeptId(insPlyIncome);
         this.getDeptId(insPlyIncome);
         this.saveByCompanyId(insFeeOrderNew, insAreaCompany.getCompanyId(), insPlyIncome);
         this.saveByCompanyId(insFeeOrderNew, insAreaCompany.getCompanyId(), insPlyIncome);
 
 
@@ -344,7 +357,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncomeLogService.saveLog(insPlyIncomeLog);  //添加日志
         insPlyIncomeLogService.saveLog(insPlyIncomeLog);  //添加日志
     }
     }
 
 
-    private void saveInsuranceProcedures(InsOrders order, InsFeeOrderNew insFeeOrderNew, InsAreaCompany insAreaCompany) {
+    private void saveInsuranceProcedures(InsOrders order, InsFeeOrderNew insFeeOrderNew, InsAreaCompany insAreaCompany,  String leaderId, String leaderName) {
 //        保险手续费
 //        保险手续费
         BigDecimal handlingAmount = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsPremiums(),
         BigDecimal handlingAmount = this.calculateTotal(insFeeOrderNew.getJqSuperviseCostsPremiums(),
                 insFeeOrderNew.getSySuperviseCostsPremiums(), null);
                 insFeeOrderNew.getSySuperviseCostsPremiums(), null);
@@ -378,6 +391,9 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
         insPlyIncome.setSyStartDate(StringOperations.emptyStringToNull(insAreaCompany.getSyStartDate()));
         insPlyIncome.setSyStartDate(StringOperations.emptyStringToNull(insAreaCompany.getSyStartDate()));
         insPlyIncome.setSyEndDate(StringOperations.emptyStringToNull(insAreaCompany.getSyEndDate()));
         insPlyIncome.setSyEndDate(StringOperations.emptyStringToNull(insAreaCompany.getSyEndDate()));
         insPlyIncome.setReceivableAmount(handlingAmount);
         insPlyIncome.setReceivableAmount(handlingAmount);
+        // 维护人
+        insPlyIncome.setLeaderId(leaderId);
+        insPlyIncome.setLeaderName(leaderName);
         this.saveByCompanyId(insFeeOrderNew, insAreaCompany.getCompanyId(), insPlyIncome);
         this.saveByCompanyId(insFeeOrderNew, insAreaCompany.getCompanyId(), insPlyIncome);
         this.getDeptId(insPlyIncome);
         this.getDeptId(insPlyIncome);
         baseMapper.insert(insPlyIncome);
         baseMapper.insert(insPlyIncome);
@@ -3617,11 +3633,11 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
             InsAreaCompany insAreaCompany = fncInsAreaCompanyMapper.selectById(subOrderId);
             InsAreaCompany insAreaCompany = fncInsAreaCompanyMapper.selectById(subOrderId);
             //大订单对象
             //大订单对象
             InsOrders order = insOrdersService.existOrder(insAreaCompany.getOrderno());
             InsOrders order = insOrdersService.existOrder(insAreaCompany.getOrderno());
-
+            SysUser sysUser = sysUserService.getById(order.getUserid());
             //获取该订单的费用
             //获取该订单的费用
             InsFeeOrderNew insFeeOrderNew = insFeeOrderNewService.getOne(new LambdaQueryWrapper<InsFeeOrderNew>()
             InsFeeOrderNew insFeeOrderNew = insFeeOrderNewService.getOne(new LambdaQueryWrapper<InsFeeOrderNew>()
                     .eq(InsFeeOrderNew::getInsOrderNo, insAreaCompany.getId()));
                     .eq(InsFeeOrderNew::getInsOrderNo, insAreaCompany.getId()));
-            saveBalanceNew(order, insFeeOrderNew,insAreaCompany) ;
+            saveBalanceNew(order, insFeeOrderNew,insAreaCompany, sysUser.getLeaderId(), sysUser.getLeaderName()) ;
         }
         }
         return HttpResult.ok(newList);
         return HttpResult.ok(newList);
     }
     }

+ 12 - 1
src/main/java/com/ydtech/modules/order/entity/InsAreaCompany.java

@@ -10,7 +10,6 @@ import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
 import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
 import com.ydtech.modules.ins.model.vo.QuoteRespVo;
 import com.ydtech.modules.ins.model.vo.QuoteRespVo;
-import com.ydtech.modules.order.constants.UnderwritingStatus;
 import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
 import com.ydtech.modules.protocol.entity.po.PtlAgreementAttribution;
 import com.ydtech.utils.StringUtils;
 import com.ydtech.utils.StringUtils;
 import com.ydtech.utils.idgen.IdGenerate;
 import com.ydtech.utils.idgen.IdGenerate;
@@ -537,6 +536,18 @@ public class InsAreaCompany implements Serializable {
     @TableField(value = "update_status_time")
     @TableField(value = "update_status_time")
     private Date updateStatusTime;
     private Date updateStatusTime;
 
 
+    /**
+     * 维护人id
+     */
+    @TableField(value = "leader_id")
+    private String leaderId;
+
+    /**
+     * 维护人名称
+     */
+    @TableField(value = "leader_name")
+    private String leaderName;
+
     public InsAreaCompany(QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution) {
     public InsAreaCompany(QuoteRespVo quoteRespVo, PtlAgreementAttribution ptlAgreementAttribution) {
         this.id = IdGenerate.nextId();
         this.id = IdGenerate.nextId();
         this.orderno = quoteRespVo.getOrderno();
         this.orderno = quoteRespVo.getOrderno();

+ 6 - 5
src/main/java/com/ydtech/modules/order/service/InsOrdersService.java

@@ -67,8 +67,6 @@ public interface InsOrdersService extends IService<InsOrders> {
     InsOrders generateOrder(SysUser user, BaseQuoteInfoVo quoteInfoVo);
     InsOrders generateOrder(SysUser user, BaseQuoteInfoVo quoteInfoVo);
 
 
 
 
-
-
     BasePageResult<InsOrders> newQueryPageOrder(OrderQueryVo orderQueryVo);
     BasePageResult<InsOrders> newQueryPageOrder(OrderQueryVo orderQueryVo);
 
 
     /**
     /**
@@ -230,7 +228,6 @@ public interface InsOrdersService extends IService<InsOrders> {
 
 
 
 
     /**
     /**
-     *
      * @param telemarketingAuditOrderQueryVo 电销审核状态查询实体
      * @param telemarketingAuditOrderQueryVo 电销审核状态查询实体
      * @return
      * @return
      */
      */
@@ -239,7 +236,7 @@ public interface InsOrdersService extends IService<InsOrders> {
     /**
     /**
      * 更新订单的起保与终保时间
      * 更新订单的起保与终保时间
      */
      */
-    void updateOrderStartingInsruanceTime(String orderno,String jqStartTime,String jqEndTime,String syStartTime,String syEndTime);
+    void updateOrderStartingInsruanceTime(String orderno, String jqStartTime, String jqEndTime, String syStartTime, String syEndTime, InsAreaCompany insAreaCompany);
 
 
     /**
     /**
      * 刷新订单的缓存信息
      * 刷新订单的缓存信息
@@ -248,6 +245,7 @@ public interface InsOrdersService extends IService<InsOrders> {
 
 
     /**
     /**
      * 根据订单id 产品id 获取订单缓存信息
      * 根据订单id 产品id 获取订单缓存信息
+     *
      * @param orderno
      * @param orderno
      * @return
      * @return
      */
      */
@@ -255,12 +253,14 @@ public interface InsOrdersService extends IService<InsOrders> {
 
 
     /**
     /**
      * 对比订单
      * 对比订单
+     *
      * @return
      * @return
      */
      */
-    boolean contrastOrder(InsOrders oldOrder,InsOrders newOrder);
+    boolean contrastOrder(InsOrders oldOrder, InsOrders newOrder);
 
 
     /**
     /**
      * 查询订单中的车牌
      * 查询订单中的车牌
+     *
      * @param queryLicenseInOrderVo 查询参数
      * @param queryLicenseInOrderVo 查询参数
      * @return 车牌列表
      * @return 车牌列表
      */
      */
@@ -268,6 +268,7 @@ public interface InsOrdersService extends IService<InsOrders> {
 
 
     /**
     /**
      * 查询订单中的被保人
      * 查询订单中的被保人
+     *
      * @param queryInsuredInOrderVo 查询实体
      * @param queryInsuredInOrderVo 查询实体
      * @return 被保人列表
      * @return 被保人列表
      */
      */

+ 2 - 2
src/main/java/com/ydtech/modules/order/service/impl/InsAreaCompanyServiceImpl.java

@@ -174,7 +174,7 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
 
 
         //更新主订单的投保时间
         //更新主订单的投保时间
         insOrdersService.updateOrderStartingInsruanceTime(insAreaCompany.getOrderno(), insAreaCompany.getJqStartDate(), insAreaCompany.getJqEndDate(),
         insOrdersService.updateOrderStartingInsruanceTime(insAreaCompany.getOrderno(), insAreaCompany.getJqStartDate(), insAreaCompany.getJqEndDate(),
-                insAreaCompany.getSyStartDate(), insAreaCompany.getSyEndDate());
+                insAreaCompany.getSyStartDate(), insAreaCompany.getSyEndDate(), insAreaCompany);
 
 
 
 
         baseMapper.insert(insAreaCompany);
         baseMapper.insert(insAreaCompany);
@@ -201,7 +201,7 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
 
 
         //更新主订单的投保时间
         //更新主订单的投保时间
         insOrdersService.updateOrderStartingInsruanceTime(insAreaCompany.getOrderno(), insAreaCompany.getJqStartDate(), insAreaCompany.getJqEndDate(),
         insOrdersService.updateOrderStartingInsruanceTime(insAreaCompany.getOrderno(), insAreaCompany.getJqStartDate(), insAreaCompany.getJqEndDate(),
-                insAreaCompany.getSyStartDate(), insAreaCompany.getSyEndDate());
+                insAreaCompany.getSyStartDate(), insAreaCompany.getSyEndDate(), insAreaCompany);
 
 
         baseMapper.insert(insAreaCompany);
         baseMapper.insert(insAreaCompany);
         //保存驾意险信息
         //保存驾意险信息

+ 10 - 1
src/main/java/com/ydtech/modules/order/service/impl/InsOrdersServiceImpl.java

@@ -2028,8 +2028,17 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
      * 更新订单的起保与终保时间
      * 更新订单的起保与终保时间
      */
      */
     @Override
     @Override
-    public void updateOrderStartingInsruanceTime(String orderno, String jqStartTime, String jqEndTime, String syStartTime, String syEndTime) {
+    public void updateOrderStartingInsruanceTime(String orderno, String jqStartTime, String jqEndTime, String syStartTime, String syEndTime, InsAreaCompany insAreaCompany) {
         InsOrders order = this.getById(orderno);
         InsOrders order = this.getById(orderno);
+        SysUser sysUser = sysUserService.getById(order.getUserid());
+
+        // 更新维护人
+        String s = Optional.ofNullable(sysUser).map(SysUser::getLeaderId).orElse(null);
+        if(StringUtils.isNotEmpty(s)){
+            insAreaCompany.setLeaderId(sysUser.getLeaderId());
+            insAreaCompany.setLeaderName(sysUser.getLeaderName());
+        }
+
         if ((Objects.isNull(order.getJqstartdate()) || !order.getJqstartdate().equals(jqStartTime)) &&
         if ((Objects.isNull(order.getJqstartdate()) || !order.getJqstartdate().equals(jqStartTime)) &&
                 (Objects.isNull(order.getJqenddate()) || !order.getJqenddate().equals(jqEndTime)) &&
                 (Objects.isNull(order.getJqenddate()) || !order.getJqenddate().equals(jqEndTime)) &&
                 (Objects.isNull(order.getSystartdate()) || !order.getSystartdate().equals(syStartTime)) &&
                 (Objects.isNull(order.getSystartdate()) || !order.getSystartdate().equals(syStartTime)) &&

+ 2 - 0
src/main/resources/mapper/modules/order/InsOrdersMapper.xml

@@ -1101,6 +1101,7 @@
             <if test="orderQueryVo.updateStatus != null and orderQueryVo.updateStatus != null">
             <if test="orderQueryVo.updateStatus != null and orderQueryVo.updateStatus != null">
                 and  iac.update_status =  #{orderQueryVo.updateStatus}
                 and  iac.update_status =  #{orderQueryVo.updateStatus}
             </if>
             </if>
+            and (iac.del_flag = '1' or io.del_flag IS NULL or io.del_flag = 1)
         </where>
         </where>
         order by io.createtime desc
         order by io.createtime desc
     </select>
     </select>
@@ -1255,6 +1256,7 @@
             <if test="orderQueryVo.updateStatus != null and orderQueryVo.updateStatus != null">
             <if test="orderQueryVo.updateStatus != null and orderQueryVo.updateStatus != null">
                 and  iac.update_status =  #{orderQueryVo.updateStatus}
                 and  iac.update_status =  #{orderQueryVo.updateStatus}
             </if>
             </if>
+            and (iac.del_flag = '1' or io.del_flag IS NULL or io.del_flag = 1)
         </where>
         </where>
         ) as s
         ) as s
     </select>
     </select>