Procházet zdrojové kódy

订单审核 留点比例只有比例没有金额
新增按钮,将私有协议的发票标记为结算完成

lipf před 3 měsíci
rodič
revize
d9f15c0b07

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

@@ -42,10 +42,7 @@ import com.jzg.commons.entity.quote.vo.orders.InsOrdersVo;
 import com.jzg.commons.entity.rights.vo.InsOrderRightsInfoVo;
 import com.jzg.commons.entity.rights.vo.InsOrderRightsInfoVo;
 import com.jzg.commons.entity.vo.*;
 import com.jzg.commons.entity.vo.*;
 import com.jzg.commons.exception.SystemException;
 import com.jzg.commons.exception.SystemException;
-import com.jzg.commons.util.AssertionUtils;
-import com.jzg.commons.util.DateTimeUtils;
-import com.jzg.commons.util.MinioUtils;
-import com.jzg.commons.util.StringUtils;
+import com.jzg.commons.util.*;
 import com.jzg.commons.util.idgen.IdGenerate;
 import com.jzg.commons.util.idgen.IdGenerate;
 import com.jzg.quotation.commons.client.OrgClient;
 import com.jzg.quotation.commons.client.OrgClient;
 import com.jzg.quotation.commons.client.PartnerDistributionClient;
 import com.jzg.quotation.commons.client.PartnerDistributionClient;
@@ -1375,15 +1372,19 @@ public class InsOrdersServiceImpl extends ServiceImpl<InsOrdersMapper, InsOrders
         // 费用信息
         // 费用信息
         InsFeeOrders insFeeOrders = insFeeOrdersMapper.selectOne(new LambdaQueryWrapper<InsFeeOrders>()
         InsFeeOrders insFeeOrders = insFeeOrdersMapper.selectOne(new LambdaQueryWrapper<InsFeeOrders>()
                 .eq(InsFeeOrders::getOrderNo, ordersNo));
                 .eq(InsFeeOrders::getOrderNo, ordersNo));
-        String systemCode = getSystemCode();
         // 比例信息
         // 比例信息
         if (insFeeOrders != null) {
         if (insFeeOrders != null) {
-            resultVo.setInsFeeOrders(new InsFeeOrdersVo(insFeeOrders));
-            // modify by lipf,  resultVo.setCostRatio(new PtlAgreementCostRatioVo(ptlAgreementCostTypeList, ptlAgreement)); 这一行代码被注视掉,那么上面两个查询也就没有必要调用了
-            // List<PtlAgreementCostTypeVo> ptlAgreementCostTypeList = orgClient.queryByCostId(insFeeOrders.getCostId());
-            //PtlAgreement ptlAgreement = orgClient.getByAgreementId(insOrdersVo.getInsOrders().getAgreementId());
-            //resultVo.setCostRatio(new PtlAgreementCostRatioVo(ptlAgreementCostTypeList, ptlAgreement));
+            // modify by lipf,
+            //resultVo.setCostRatio(new PtlAgreementCostRatioVo(ptlAgreementCostTypeList, ptlAgreement)); 这一行代码被注视掉,那么上面两个查询也就没有必要调用了
+//            List<PtlAgreementCostTypeVo> ptlAgreementCostTypeList = orgClient.queryByCostId(insFeeOrders.getCostId());
+//            PtlAgreement ptlAgreement = orgClient.getByAgreementId(insOrdersVo.getInsOrders().getAgreementId());
+//            resultVo.setCostRatio(new PtlAgreementCostRatioVo(ptlAgreementCostTypeList, ptlAgreement));
             resultVo.setCostRatio(new PtlAgreementCostRatioVo(insFeeOrders));
             resultVo.setCostRatio(new PtlAgreementCostRatioVo(insFeeOrders));
+            // add by lipf, 手动计算留点比例的费用 2026年6月11日11:31:39
+            insFeeOrders.setJqKeepPointPremium(BigDecimalUtil.divide( BigDecimalUtil.multiply(insFeeOrders.getJqPremium(),resultVo.getCostRatio().getJqKeepPointRatio()),new BigDecimal(100)));
+            insFeeOrders.setSyKeepPointPremium(BigDecimalUtil.divide(BigDecimalUtil.multiply(insFeeOrders.getSyPremium(),resultVo.getCostRatio().getSyKeepPointRatio()),new BigDecimal(100)));
+            insFeeOrders.setJyKeepPointPremium(BigDecimalUtil.divide(BigDecimalUtil.multiply(insFeeOrders.getJyPremium(),resultVo.getCostRatio().getJyKeepPointRatio()),new BigDecimal(100)));
+            resultVo.setInsFeeOrders(new InsFeeOrdersVo(insFeeOrders));
         }
         }
         //权益信息
         //权益信息
         InsOrderRightsInfoVo insOrderRightsInfoVo = insOrderRightsInfoService.queryByOrderNo(ordersNo);
         InsOrderRightsInfoVo insOrderRightsInfoVo = insOrderRightsInfoService.queryByOrderNo(ordersNo);

+ 18 - 0
tenant/organization/src/main/java/com/jzg/organization/controller/ReceivableController.java

@@ -663,6 +663,24 @@ public class ReceivableController {
         return receivableService.companySuperviseSettlementReport(settlementReportQueryVo);
         return receivableService.companySuperviseSettlementReport(settlementReportQueryVo);
     }
     }
 
 
+    /**
+     * 设置指定发票为结算完成状态
+     *
+     * @param invoiceId 发票序号
+     * @author lipf
+     * @date 2026/6/11 9:33
+     */
+    @PostMapping("updateSettlementStatus")
+    public HttpResult<String> updateSettlementStatus(@RequestParam("id") String invoiceId){
+        int count = receivableService.updateSettlementStatus(invoiceId);
+        if(count>0){
+            return HttpResult.ok("订单被标记为结算完成");
+        }else{
+            // 可能已经被其他人标记为结算完成
+            return HttpResult.ok("操作完成");
+        }
+    }
+
     @PostMapping("receiverSettlementReport")
     @PostMapping("receiverSettlementReport")
     @Operation(summary = "对接人结算报表")
     @Operation(summary = "对接人结算报表")
     public HttpResult<Page<ReceiverSettlementReportDto>> receiverSettlementReport(@RequestBody SettlementReportQueryVo settlementReportQueryVo) {
     public HttpResult<Page<ReceiverSettlementReportDto>> receiverSettlementReport(@RequestBody SettlementReportQueryVo settlementReportQueryVo) {

+ 1 - 4
tenant/organization/src/main/java/com/jzg/organization/mapper/ReceivableMapper.java

@@ -3,10 +3,7 @@ package com.jzg.organization.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.jzg.commons.entity.finance.dto.*;
 import com.jzg.commons.entity.finance.dto.*;
-import com.jzg.commons.entity.finance.po.InsPlyIncome;
-import com.jzg.commons.entity.finance.po.InsPlyIncomeInvoiceLink;
-import com.jzg.commons.entity.finance.po.InsPlyIncomeInvoiceSettlement;
-import com.jzg.commons.entity.finance.po.InsPlyIncomeVO;
+import com.jzg.commons.entity.finance.po.*;
 import com.jzg.commons.entity.finance.vo.InvoiceRecordQueryVo;
 import com.jzg.commons.entity.finance.vo.InvoiceRecordQueryVo;
 import com.jzg.commons.entity.finance.vo.InvoiceRecordResult;
 import com.jzg.commons.entity.finance.vo.InvoiceRecordResult;
 import com.jzg.commons.entity.finance.vo.InvoicingVo;
 import com.jzg.commons.entity.finance.vo.InvoicingVo;

+ 9 - 0
tenant/organization/src/main/java/com/jzg/organization/service/ReceivableService.java

@@ -457,4 +457,13 @@ public interface ReceivableService extends IService<InsPlyIncome> {
      * @return
      * @return
      */
      */
     Page<ExportSuperviseSettlementExcelDto> followSettlementExcel(Page page, SettlementQueryVo settlementQueryVo);
     Page<ExportSuperviseSettlementExcelDto> followSettlementExcel(Page page, SettlementQueryVo settlementQueryVo);
+
+    /**
+     * 设置指定发票为结算完成状态
+     *
+     * @param invoiceId 发票序号
+     * @author lipf
+     * @date 2026/6/11 9:33
+     */
+    int updateSettlementStatus(String invoiceId);
 }
 }

+ 29 - 0
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -1458,6 +1458,16 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
     @Override
     @Override
     public boolean deleteSettlementById(String id) {
     public boolean deleteSettlementById(String id) {
         log.info("私有协议-结算记录-删除: id=[{}]",id);
         log.info("私有协议-结算记录-删除: id=[{}]",id);
+        InsPlyIncomeInvoiceSettlement settlement = insPlyIncomeInvoiceSettlementMapper.selectById(id);
+        if(settlement == null){
+            return false;
+        }
+        String invoiceId = settlement.getInvoiceId();
+        if(StrUtil.isNotEmpty(invoiceId)){
+            insPlyIncomeInvoiceMapper.update(null,
+                    new LambdaUpdateWrapper<InsPlyIncomeInvoice>()
+                            .set(InsPlyIncomeInvoice::getStatus,"0").eq(InsPlyIncomeInvoice::getId,invoiceId));
+        }
         return insPlyIncomeInvoiceSettlementMapper.deleteById(id) > 0;
         return insPlyIncomeInvoiceSettlementMapper.deleteById(id) > 0;
     }
     }
 
 
@@ -3576,5 +3586,24 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         log.info(msg);
         log.info(msg);
         return HttpResult.ok(msg);
         return HttpResult.ok(msg);
     }
     }
+
+    /**
+     * 设置指定发票为结算完成状态
+     *
+     * @param invoiceId 发票序号
+     * @author lipf
+     * @date 2026/6/11 9:33
+     */
+    @Override
+    public int updateSettlementStatus(String invoiceId) {
+        String userName = baseController.getUserName();
+        String systemCode = baseController.getSystemCode();
+        log.info("租户[{}]下的用户[{}]标识发票[{}]为结算完成", systemCode, userName, invoiceId);
+        return insPlyIncomeInvoiceMapper.update(null, new LambdaUpdateWrapper<InsPlyIncomeInvoice>()
+                .set(InsPlyIncomeInvoice::getStatus,"1")
+                .set(InsPlyIncomeInvoice::getUpdateBy,userName)
+                .set(InsPlyIncomeInvoice::getUpdateTime, LocalDateTime.now())
+                .eq(InsPlyIncomeInvoice::getId, invoiceId));
+    }
 }
 }