platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractServiceImpl.java
@@ -24,6 +24,7 @@
import com.by4cloud.platformx.business.mapper.*;
import com.by4cloud.platformx.business.service.ContractService;
import com.by4cloud.platformx.business.utils.ItemGeneratorUtil;
import com.by4cloud.platformx.business.utils.NetworkFileToBase64;
import com.by4cloud.platformx.business.vo.ContractDetailVo;
import com.by4cloud.platformx.business.vo.ContractInvoiceVo;
import com.by4cloud.platformx.business.vo.ContractSlipVo;
@@ -267,7 +268,7 @@
      if (StrUtil.isEmpty(updateDTO.getPartyA())){
         BusinessCustomer bc = businessCustomerMapper.selectById(updateDTO.getPartyAId());
         if (ObjUtil.isNotNull(bc)){
            updateDTO.setPartyA(bc.getRegisterName());
            updateDTO.setPartyA(bc.getCompanyName());
         }
         if (StrUtil.isEmpty(bc.getErpCompanyCode())||StrUtil.isEmpty(bc.getRegisterName())||
               StrUtil.isEmpty(bc.getBankName())||StrUtil.isEmpty(bc.getBankAccount())){
@@ -719,25 +720,60 @@
      //合同中心推送
      new Thread(()->{
         try {
            JSONObject request = new JSONObject();
            request.put("fd_docNumber",contract.getContractNo());
            request.put("fd_singer",contract.getNickName());
            request.put("fd_signTime",DateUtil.formatDate(contract.getSignDate()));
            request.put("fd_linkPerson","");
            request.put("fd_linkPhone","");
            request.put("fd_address",contract.getSignPlace());
            request.put("fd_receivedTime",DateUtil.format(contract.getCreateTime(),DatePattern.NORM_DATETIME_PATTERN));
            request.put("fd_receivedNum",1);
            request.put("fd_effedate",DateUtil.formatDate(contract.getEffectiveDate()));
            request.put("fd_enddate",DateUtil.formatDate(contract.getExpirationDate()));
            request.put("fd_reviewerNo",contract.getNickName());
            request.put("fd_docStatus","20");
            request.put("fd_templateId","");
            request.put("fd_attName",contract.getAttachmentName());
            request.put("fd_attcontent",contract.getAttachmentName());
            log.info("合同中心同步合同接口入参:{}",request.toJSONString());
            String resp = HttpUtil.post("https://oatest.res.jzeg.cn/ekp/api/km-agreement/kmAgreementWebService/addContractReview",request.toJSONString());
            log.info("合同中心同步合同接口回参:{}",resp);
            JSONObject requestApply = new JSONObject();
            requestApply.put("fd_selectionmethod","公开招标");
            requestApply.put("fd_isrelated","是");
            requestApply.put("fd_bizId",contract.getId());
            requestApply.put("fd_remark",contract.getRemark());
            requestApply.put("fd_MainContent","");
            requestApply.put("fd_settlementType","00");
            requestApply.put("fd_applyType","外销");
            requestApply.put("fd_contractsubject ",subjectMatterList.stream().map(item->item.getMaterialName()).collect(Collectors.joining(",")));
            requestApply.put("fd_docNumber",contract.getContractNo());
            requestApply.put("fd_templateId","19e39bb6c1edadbdb162c434274a8a18");
            requestApply.put("fd_name",contract.getContractName());
            requestApply.put("fd_signDate",DateUtil.formatDate(contract.getSignDate()));
            requestApply.put("fd_endDate",DateUtil.formatDate(contract.getExpirationDate()));
            requestApply.put("fd_contractCreater",contract.getNickName());
            requestApply.put("fd_currency","人民币");
            requestApply.put("fd_ContractAmount",contract.getAmount());
            requestApply.put("fd_finAmount",contract.getAmount().divide(new BigDecimal("113"),2,RoundingMode.HALF_UP)
                  .multiply(new BigDecimal("87")));
            requestApply.put("fd_docStatus","20");
            requestApply.put("fd_taxRates",13);
            requestApply.put("fd_customerName",contract.getPartyA());
            requestApply.put("fd_systemSource","非煤销售系统");
            requestApply.put("fd_type","00");
            log.info("合同中心合同起草接口入参:{}",requestApply.toJSONString());
            String respApply = HttpUtil.post("https://oatest.res.jzeg.cn/ekp/api/km-agreement/kmAgreementWebService/addSupplyContractApply",requestApply.toJSONString());
            log.info("合同中心合同起草接口回参:{}",respApply);
            JSONObject applyResp = JSONObject.parseObject(respApply);
            if (applyResp.getString("code").equals("00")) {
               JSONObject request = new JSONObject();
               request.put("fd_docNumber", contract.getContractNo());
               request.put("fd_singer", contract.getNickName());
               request.put("fd_signTime", DateUtil.formatDate(contract.getSignDate()));
               request.put("fd_linkPerson", "");
               request.put("fd_linkPhone", "");
               request.put("fd_address", contract.getSignPlace());
               request.put("fd_receivedTime", DateUtil.format(contract.getCreateTime(), DatePattern.NORM_DATETIME_PATTERN));
               request.put("fd_receivedNum", 1);
               request.put("fd_effedate", DateUtil.formatDate(contract.getSignDate()));
               request.put("fd_enddate", DateUtil.formatDate(contract.getExpirationDate()));
               request.put("fd_reviewerNo", contract.getNickName());
               request.put("fd_docStatus", "20");
               request.put("fd_templateId", "19e39bb6c1edadbdb162c434274a8a18");
               request.put("fd_attName", contract.getAttachmentName());
               request.put("fd_attcontent", NetworkFileToBase64.convertNetworkFileToBase64("https://zbjt.res.jzeg.cn/api" + contract.getAttachmentUrl()));
               log.info("合同中心同步合同接口入参:{}", request.toJSONString());
               String resp = HttpUtil.post("https://oatest.res.jzeg.cn/ekp/api/km-agreement/kmAgreementWebService/addContractReview", request.toJSONString());
               log.info("合同中心同步合同接口回参:{}", resp);
               JSONObject respJson = JSONObject.parseObject(resp);
               if (respJson.getString("code").equals("00")) {
                  contract.setCenterPushFlag("1");
                  baseMapper.updateById(contract);
               }
            }
         } catch (Exception e) {
            e.printStackTrace();
         }
@@ -907,6 +943,7 @@
   public R copyNewContract(Long id) {
      Contract oldContract = baseMapper.selectById(id);
      Contract newContract = BeanUtil.copyProperties(oldContract, Contract.class, "id", "createTime");
      newContract.setOutBoundAmout(new BigDecimal("0"));
      newContract.setPaidAmount(new BigDecimal("0"));
      newContract.setBillingStatus("1");
      newContract.setErpPushFlag("0");
@@ -1579,6 +1616,7 @@
         return R.failed("erp客户编码不存在");
      }
      contract.setPartyAId(bc.getId());
      contract.setPartyA(bc.getCompanyName());
      if (ObjUtil.isNotNull(addDTO.getDeliveryCycle())){
         contract.setExpirationDate(DateUtil.offsetDay(addDTO.getSignDate(),addDTO.getDeliveryCycle()));
      }