Ver código fonte

批改后的应收数据

Qchen 11 meses atrás
pai
commit
fd748de0e2

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

@@ -6,6 +6,8 @@ import com.jzg.commons.entity.finance.dto.*;
 import com.jzg.commons.entity.finance.po.InsPlyIncome;
 import com.jzg.commons.entity.finance.po.InsPlyIncomeInvoiceSettlement;
 import com.jzg.commons.entity.finance.vo.*;
+import com.jzg.commons.entity.orders.po.InsOrders;
+import com.jzg.commons.entity.orders.po.InsOrdersPolicy;
 import com.jzg.commons.entity.po.EsmInsCompany;
 import com.jzg.commons.entity.scheme.po.PtlScheme;
 import org.springframework.web.multipart.MultipartFile;
@@ -246,4 +248,10 @@ public interface ReceivableService extends IService<InsPlyIncome> {
     Page<ReceiverSettlementReportDto> receiverSettlementReport(Page page,SettlementReportQueryVo settlementReportQueryVo);
 
     void exportReceiverSettlementReportExcel(Page page,SettlementReportQueryVo settlementReportQueryVo);
+
+    /**
+     * 批改订单后应收重新添加
+     */
+    void restockInsPlyIncome(String orderNo,String companyId);
+
 }

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

@@ -15,6 +15,7 @@ import com.jzg.commons.entity.finance.vo.*;
 import com.jzg.commons.entity.po.EsmInsCompany;
 import com.jzg.commons.entity.po.PtlAgreement;
 import com.jzg.commons.entity.po.SysUploadFiles;
+import com.jzg.commons.exception.SystemException;
 import com.jzg.commons.util.AssertionUtils;
 import com.jzg.commons.util.EasyExcelUtils;
 import com.jzg.commons.util.MinioUtils;
@@ -29,6 +30,7 @@ import com.jzg.organization.service.ReceivableService;
 import org.redisson.api.RBucket;
 import org.redisson.api.RKeys;
 import org.redisson.api.RedissonClient;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -1214,5 +1216,18 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
         List<ReceiverSettlementReportDto> receiverSettlementReportDtos = receiverSettlementReport.getRecords();
         EasyExcelUtils.exportForWeb(ServletUtils.getResponse(), ReceiverSettlementReportDto.class, receiverSettlementReportDtos, "对接人结算报表");
     }
+
+    @Override
+    public void restockInsPlyIncome(String orderNo, String companyId) {
+        List<InsPlyIncome> insPlyIncomeList = baseMapper
+                .selectList(new LambdaQueryWrapper<InsPlyIncome>().eq(InsPlyIncome::getOrderNo, orderNo).eq(InsPlyIncome::getCompanyId, companyId));
+        if (insPlyIncomeList.isEmpty()) {
+            throw new SystemException("未找到该应收订单");
+        }
+        InsPlyIncome insPlyIncome = insPlyIncomeList.get(0);
+        InsPlyIncome restockInsPlyIncome = new InsPlyIncome();
+        BeanUtils.copyProperties(insPlyIncome, restockInsPlyIncome);
+        this.save(restockInsPlyIncome);
+    }
 }