shiyunteng
2026-08-24 9c49ede494a10d7e7a322eb2e793afa412ea07e1
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractServiceImpl.java
@@ -1,6 +1,7 @@
package com.by4cloud.platformx.business.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
@@ -54,6 +55,8 @@
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
;
/**
 * @author cd
 * @description
@@ -80,6 +83,7 @@
   private final PaymentSlipMapper paymentSlipMapper;
   private final ContractInvoiceMapper contractInvoiceMapper;
   private final StringRedisTemplate redisTemplate;
   private final ContractOutBoundMapper contractOutBoundMapper;
   @Value("${erp.ymj}")
   private String ymjErp;
@@ -98,6 +102,12 @@
   @Value("${dept.smj}")
   private String smj;
   @Value("${dept.smjsc}")
   private String smjsc;
   @Value("${dept.smjzt}")
   private String smjzt;
   @Value("${dept.sgb}")
   private String sgb;
@@ -155,11 +165,12 @@
         }
      }
      if (ArrayUtil.isEmpty(addDTO.getContractSubjectMatter().toArray())){
      if (CollUtil.isEmpty(addDTO.getContractSubjectMatter())){
         return R.failed("标的物不能为空");
      }
      if (StrUtil.equals(SecurityUtils.getUser().getCompId()+"",smj)){
      if (StrUtil.equals(SecurityUtils.getUser().getCompId()+"",smj)||StrUtil.equals(SecurityUtils.getUser().getCompId()+"",smjsc)||
            StrUtil.equals(SecurityUtils.getUser().getCompId()+"",smjzt)){
         contract.setContractNo(generateSMJContractNo());
      }
      if (StrUtil.equals(SecurityUtils.getUser().getCompId()+"",sgb)){
@@ -183,7 +194,7 @@
      }
      baseMapper.insert(contract);
      if (ArrayUtil.isNotEmpty(addDTO.getContractSubjectMatter())) {
      if (CollUtil.isNotEmpty(addDTO.getContractSubjectMatter())) {
         addDTO.getContractSubjectMatter().stream().forEach(contractSubjectMatterAddDTO -> {
            ContractSubjectMatter subjectMatter = BeanUtil.copyProperties(contractSubjectMatterAddDTO, ContractSubjectMatter.class);
            subjectMatter.setContractId(contract.getId());
@@ -214,7 +225,7 @@
      }
      if (ArrayUtil.isNotEmpty(addDTO.getContractPaymentSchedule())) {
      if (CollUtil.isNotEmpty(addDTO.getContractPaymentSchedule())) {
         AtomicInteger index = new AtomicInteger(1);
         addDTO.getContractPaymentSchedule().stream().forEach(contractPaymentScheduleAddDTO -> {
            int currentIndex = index.getAndIncrement();
@@ -282,7 +293,8 @@
      contract.setPaidAmount(new BigDecimal("0"));
      contract.setBillingAmout(new BigDecimal("0"));
      contract.setNickName(SecurityUtils.getUser().getNickname());
      if (StrUtil.equals(SecurityUtils.getUser().getCompId()+"",smj)){
      if (StrUtil.equals(SecurityUtils.getUser().getCompId()+"",smj)||StrUtil.equals(SecurityUtils.getUser().getCompId()+"",smjsc)||
            StrUtil.equals(SecurityUtils.getUser().getCompId()+"",smjzt)){
         contract.setContractNo(generateSMJContractNo());
      }
      if (StrUtil.equals(SecurityUtils.getUser().getCompId()+"",sgb)){
@@ -323,7 +335,7 @@
      }
      baseMapper.updateById(contract);
      if (ArrayUtil.isNotEmpty(updateDTO.getContractSubjectMatter())) {
      if (CollUtil.isNotEmpty(updateDTO.getContractSubjectMatter())) {
         contractSubjectMatterMapper.delete(Wrappers.<ContractSubjectMatter>lambdaQuery().eq(ContractSubjectMatter::getContractId, contract.getId()));
         updateDTO.getContractSubjectMatter().stream().forEach(contractSubjectMatterAddDTO -> {
@@ -350,7 +362,7 @@
         });
      }
      if (ArrayUtil.isNotEmpty(updateDTO.getContractPaymentSchedule())) {
      if (CollUtil.isNotEmpty(updateDTO.getContractPaymentSchedule())) {
         contractPaymentScheduleMapper.delete(Wrappers.<ContractPaymentSchedule>lambdaQuery().eq(ContractPaymentSchedule::getContractId, contract.getId()));
         AtomicInteger index = new AtomicInteger(1);
@@ -398,12 +410,37 @@
      if (ObjUtil.isNotNull(a)){
         detailVo.setPartyAOrgCode(a.getCreditCode());
      }
      List<ContractOutBound> outBoundList = contractOutBoundMapper.selectList(Wrappers.<ContractOutBound>lambdaQuery()
            .eq(ContractOutBound::getContractId,id).orderByAsc(ContractOutBound::getOutBoundTime));
      if (CollUtil.isNotEmpty(outBoundList)){
         detailVo.setContractOutBound(outBoundList);
      }
      List<ContractInvoice> invoiceList = contractInvoiceMapper.selectList(Wrappers.<ContractInvoice>lambdaQuery()
            .eq(ContractInvoice::getContractId,id).orderByAsc(ContractInvoice::getCreateTime));
      if (CollUtil.isNotEmpty(invoiceList)){
         detailVo.setContractInvoice(invoiceList);
      }
      List<PaymentSlip> slipList = paymentSlipMapper.selectList(Wrappers.<PaymentSlip>lambdaQuery()
            .eq(PaymentSlip::getContractId,id).orderByAsc(PaymentSlip::getPaymentTime));
      if (CollUtil.isNotEmpty(slipList)){
         detailVo.setPaymentSlip(slipList);
      }
      BusinessCustomer customer = businessCustomerMapper.selectById(contract.getPartyAId());
      if (ObjUtil.isNotNull(customer)){
         detailVo.setInvoiceType(customer.getInvoiceType());
      }
      return detailVo;
   }
   @Override
   public R startApproval(Long id) {
      Contract contract = baseMapper.selectById(id);
      //简易合同无法继续后续操作
      if (StrUtil.equals(contract.getContractCategory(), "simple")){
         return R.failed("请补充标的物和收款阶段后再进行操作!");
      }
      //启动流程
      ProcessInstanceParamDto dto = new ProcessInstanceParamDto();
      Map<String, Object> map = BeanUtil.beanToMap(contract);
@@ -423,10 +460,11 @@
      contract.setContractStatus(2);
      baseMapper.updateById(contract);
      List<ContractSubjectMatter> subjectMatterList = contractSubjectMatterMapper.selectList(Wrappers.<ContractSubjectMatter>lambdaQuery()
            .eq(ContractSubjectMatter::getContractId,id));
      if (StrUtil.isNotEmpty(contract.getContractCategory()) && StrUtil.equals(contract.getContractCategory(), "water_house")) {
         if (ArrayUtil.isNotEmpty(subjectMatterList.toArray())) {
         if (CollUtil.isNotEmpty(subjectMatterList)) {
            for (ContractSubjectMatter contractSubjectMatter: subjectMatterList)  {
               if (StrUtil.equals(contract.getExecFrequency(), "1")) {
                  Long weeksTrue = DateUtil.betweenWeek(DateUtil.beginOfWeek(contract.getEffectiveDate()),
@@ -576,7 +614,7 @@
               .eq(ContractPaymentSchedule::getContractId, fitstSchedule.getContractId())
               .gt(ContractPaymentSchedule::getStageOrder, fitstSchedule.getStageOrder())
               .orderByAsc(ContractPaymentSchedule::getCreateTime));
         if (ArrayUtil.isNotEmpty(afterSchedule.toArray()) && afterSchedule.size() == 1) {
         if (ArrayUtil.isNotEmpty(afterSchedule) && afterSchedule.size() == 1) {
            //最后阶段生效时间
            ContractPaymentSchedule endSchedule = afterSchedule.get(0);
            if (StrUtil.equals(endSchedule.getStageName(), "质保金")) {
@@ -610,7 +648,7 @@
            contract.setNextScheduleName(endSchedule.getStageName());
            baseMapper.updateById(contract);
         }
         if (ArrayUtil.isNotEmpty(afterSchedule.toArray()) && afterSchedule.size() > 1) {
         if (ArrayUtil.isNotEmpty(afterSchedule) && afterSchedule.size() > 1) {
            //第一阶段生效时间
//         fitstSchedule.setEffectiveEndDate(DateUtil.offsetDay(contract.getSignDate(),fitstSchedule.getAgreedDays()));
//         contractPaymentScheduleMapper.updateById(fitstSchedule);
@@ -619,7 +657,7 @@
            baseMapper.updateById(contract);
         }
         //只有当前合同签字阶段
//      if(ArrayUtil.isEmpty(afterSchedule.toArray())){
//      if(ArrayUtil.isEmpty(afterSchedule)){
//         fitstSchedule.setEffectiveEndDate(DateUtil.offsetDay(contract.getSignDate(),fitstSchedule.getAgreedDays()));
//         contractPaymentScheduleMapper.updateById(fitstSchedule);
//      }
@@ -641,7 +679,7 @@
               request.put("moneySum",contract.getAmount());
               request.put("signManner","面签");
               request.put("salesman","");
               if (ArrayUtil.isNotEmpty(subjectMatterList.toArray())){
               if (ArrayUtil.isNotEmpty(subjectMatterList)){
                  JSONArray subjectMatter = new JSONArray();
                  subjectMatterList.stream().forEach(contractSubjectMatter -> {
                     JSONObject subjectMatterItem = new JSONObject();
@@ -686,15 +724,58 @@
               }
            }
            if (StrUtil.equals(contract.getPartyBId()+"",smj)&&StrUtil.isNotEmpty(smjErp)){
               log.info("石煤机合同推送erp入参:{}",request.toJSONString());
               String result = HttpUtil.post(smjErp,request.toJSONString());
               log.info("石煤机合同推送erp回参:{}",result);
               //保存请求记录
               saveErpRequestRecord("smj",request.toJSONString(),result);
               //更新合同erp推送标识
               contract.setErpPushFlag("1");
               baseMapper.updateById(contract);
            if ((StrUtil.equals(contract.getPartyBId()+"",smj)||StrUtil.equals(contract.getPartyBId()+"",smjsc)||
                  StrUtil.equals(contract.getPartyBId()+"",smjzt))&&StrUtil.isNotEmpty(smjErp)){
               request.put("customerCode",customer.getErpCompanyCode());
               request.put("currencyId","RMB");
               request.put("signDate",DateUtil.format(contract.getSignDate(),DatePattern.NORM_DATETIME_PATTERN));
               request.put("dateDeliver",DateUtil.format(contract.getExpirationDate(),DatePattern.NORM_DATETIME_PATTERN));
               request.put("moneySum",contract.getAmount());
               request.put("signManner","面签");
               request.put("salesman","");
               if (ArrayUtil.isNotEmpty(subjectMatterList)){
                  JSONArray subjectMatter = new JSONArray();
                  subjectMatterList.stream().forEach(contractSubjectMatter -> {
                     JSONObject subjectMatterItem = new JSONObject();
                     subjectMatterItem.put("itemNo",contractSubjectMatter.getMaterialCode());
                     subjectMatterItem.put("salePrice",contractSubjectMatter.getUnitPrice());
                     subjectMatterItem.put("qtyRequired",contractSubjectMatter.getQuantity());
                     subjectMatterItem.put("money",contractSubjectMatter.getQuantity().multiply(contractSubjectMatter.getUnitPrice()));
                     Product product = productMapper.selectOne(Wrappers.<Product>lambdaQuery().eq(Product::getCompId,contract.getCompId())
                           .eq(Product::getErpCode,contractSubjectMatter.getMaterialCode()));
                     if (ObjUtil.isNotNull(product)){
                        subjectMatterItem.put("taxRate",new BigDecimal(product.getTaxRate()).divide(new BigDecimal("100")));
                     }
                     subjectMatterItem.put("dateDeliver",ObjUtil.isNotNull(contractSubjectMatter.getPlannedDeliveryDate())?
                           DateUtil.format(contractSubjectMatter.getPlannedDeliveryDate(),DatePattern.NORM_DATETIME_PATTERN):
                           DateUtil.format(contract.getExpirationDate(),DatePattern.NORM_DATETIME_PATTERN));
                     subjectMatter.add(subjectMatterItem);
                  });
                  request.put("details",subjectMatter);
               }
               JSONObject loginJson = new JSONObject();
               loginJson.put("username","admin");
               loginJson.put("password","Zimafold@2026");
               log.info("石煤机合同推送获取token入参:{}",loginJson.toJSONString());
               String loginResp = HttpUtil.post(smjErp+"/api/account/v1/login",loginJson.toJSONString());
               log.info("石煤机合同推送获取token回参:{}",loginResp);
               JSONObject respJson = JSONObject.parseObject(loginResp);
               if (respJson.getInteger("code")==0){
                  JSONObject dataJson = JSONObject.parseObject(respJson.getString("data"));
                  log.info("石煤机合同推送erp入参:{}",request.toJSONString());
                  HttpResponse response = HttpRequest.post(smjErp+"/api/contract/v1/createWithDetails")
                        .header("token", dataJson.getString("token"))       // 添加认证头
                        .header("Content-Type", "application/json")         // 设置内容类型
                        .body(request.toJSONString())                        // 设置请求体
                        .execute();                                         // 执行请求.post(ymjErp,request.toJSONString());
                  log.info("石煤机合同推送erp回参:{}",response.body());
                  //保存请求记录
                  saveErpRequestRecord("smj",request.toJSONString(),response.body());
                  //更新合同erp推送标识
                  contract.setErpPushFlag("1");
                  baseMapper.updateById(contract);
               }
            }
            if (StrUtil.equals(contract.getPartyBId()+"",jxc)&&StrUtil.isNotEmpty(jxcErp)){
@@ -834,7 +915,7 @@
               outAmountList.add(outConfirm.getTransationAmount());
            }
         }
         if (ArrayUtil.isNotEmpty(outAmountList.toArray())) {
         if (ArrayUtil.isNotEmpty(outAmountList)) {
            BigDecimal currentInSum = outAmountList.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
            //新增当前合同 资金转入
            PaymentConfirm inConfirm = BeanUtil.copyProperties(paymentConfirm, PaymentConfirm.class, "id", "transationAmount",
@@ -870,7 +951,7 @@
            .lt(ContractPaymentSchedule::getEffectiveEndDate, DateUtil.today())
            .ne(ContractPaymentSchedule::getPaymentStatus, "2")
            .ne(ContractPaymentSchedule::getPaymentStatus, 3));
      if (ArrayUtil.isNotEmpty(scheduleList.toArray())) {
      if (ArrayUtil.isNotEmpty(scheduleList)) {
         scheduleList.stream().forEach(contractPaymentSchedule -> {
            Contract contract = baseMapper.selectById(contractPaymentSchedule.getContractId());
            if (ObjUtil.isNotNull(contract)) {
@@ -949,7 +1030,8 @@
      newContract.setErpPushFlag("0");
      newContract.setContractStatus(0);
      newContract.setBillingAmout(new BigDecimal("0"));
      if (StrUtil.equals(SecurityUtils.getUser().getCompId()+"",smj)){
      if (StrUtil.equals(SecurityUtils.getUser().getCompId()+"",smj)||StrUtil.equals(SecurityUtils.getUser().getCompId()+"",smjsc)||
            StrUtil.equals(SecurityUtils.getUser().getCompId()+"",smjzt)){
         newContract.setContractNo(generateSMJContractNo());
      }
      if (StrUtil.equals(SecurityUtils.getUser().getCompId()+"",sgb)){
@@ -1077,7 +1159,7 @@
   public R genCycleReceiced() {
      List<ContractExecDate> execDateList = contractExecDateMapper.selectList(Wrappers.<ContractExecDate>lambdaQuery()
            .le(ContractExecDate::getExecDate, DateUtil.today()).eq(ContractExecDate::getGenFlag,"0"));
      if (ArrayUtil.isNotEmpty(execDateList.toArray())) {
      if (ArrayUtil.isNotEmpty(execDateList)) {
         execDateList.stream().forEach(contractExecDate -> {
            Contract contract = baseMapper.selectById(contractExecDate.getContractId());
            ContractSubjectMatter subjectMatter = contractSubjectMatterMapper.selectOne(Wrappers.<ContractSubjectMatter>lambdaQuery()
@@ -1153,6 +1235,8 @@
            }
            contractExecDate.setGenFlag("1");
            contractExecDateMapper.updateById(contractExecDate);
            contract.setBillingStatus("2");
            baseMapper.updateById(contract);
         });
      }
      return R.ok();
@@ -1587,10 +1671,10 @@
   @Override
   public R addContractSgb(ContractAddDTO addDTO) {
      if (ArrayUtil.isEmpty(addDTO.getContractSubjectMatter().toArray())){
      if (ArrayUtil.isEmpty(addDTO.getContractSubjectMatter())){
         return R.failed("请添加标的物");
      }
      if (ArrayUtil.isEmpty(addDTO.getContractPaymentSchedule().toArray())){
      if (ArrayUtil.isEmpty(addDTO.getContractPaymentSchedule())){
         return R.failed("请添加付款阶段或付款阶段缺少");
      }
      if (!isValidPaymentStages(addDTO.getContractPaymentSchedule())){
@@ -1710,10 +1794,10 @@
   @Override
   public R updateContractSgb(ContractUpdateDTO updateDTO) {
      if (ArrayUtil.isEmpty(updateDTO.getContractSubjectMatter().toArray())){
      if (ArrayUtil.isEmpty(updateDTO.getContractSubjectMatter())){
         return R.failed("请添加标的物");
      }
      if (ArrayUtil.isEmpty(updateDTO.getContractPaymentSchedule().toArray())){
      if (ArrayUtil.isEmpty(updateDTO.getContractPaymentSchedule())){
         return R.failed("请添加付款阶段或付款阶段缺少");
      }
      if (!isValidPaymentStages(updateDTO.getContractPaymentSchedule())){
@@ -1964,20 +2048,22 @@
   @Override
   public Page fourAssociation(Page page,ContractQueryDTO queryDTO) {
      Page<FourAssociationPageVo> page1 = baseMapper.fourAssociation(page,queryDTO,DataScope.of("comp_id"));
      if (ArrayUtil.isNotEmpty(page1.getRecords().toArray())){
      if (ArrayUtil.isNotEmpty(page1.getRecords())){
         page1.getRecords().stream().forEach(fourAssociationPageVo -> {
            List<PaymentSlip> slips = paymentSlipMapper.selectList(Wrappers.<PaymentSlip>lambdaQuery().eq(PaymentSlip::getContractId,fourAssociationPageVo.getId())
                  .orderByAsc(PaymentSlip::getPaymentTime));
            if (ArrayUtil.isNotEmpty(slips.toArray())){
            if (ArrayUtil.isNotEmpty(slips)){
               fourAssociationPageVo.setSlipVoList(BeanUtil.copyToList(slips,ContractSlipVo.class));
            }
            List<ContractInvoice> invoices = contractInvoiceMapper.selectList(Wrappers.<ContractInvoice>lambdaQuery().eq(ContractInvoice::getContractId,fourAssociationPageVo.getId())
                  .orderByAsc(ContractInvoice::getInvoiceTime));
            if (ArrayUtil.isNotEmpty(invoices.toArray())){
            if (ArrayUtil.isNotEmpty(invoices)){
               fourAssociationPageVo.setInvoiceVoList(BeanUtil.copyToList(invoices, ContractInvoiceVo.class));
            }
            if (fourAssociationPageVo.getAmount().compareTo(fourAssociationPageVo.getPaidAmount())==0&&
                  fourAssociationPageVo.getAmount().compareTo(fourAssociationPageVo.getBillingAmout())==0){
                  fourAssociationPageVo.getAmount().compareTo(fourAssociationPageVo.getBillingAmout())==0&&
               ArrayUtil.isNotEmpty(slips)&&ArrayUtil.isNotEmpty(invoices)
            ){
               fourAssociationPageVo.setAssociation("已完成");
            }
         });
@@ -2195,4 +2281,104 @@
         e.printStackTrace();
      }
   }
   @Override
   public R addSimple(ContractAddDTO addDTO) {
      Contract contract = BeanUtil.copyProperties(addDTO, Contract.class);
      contract.setPartyBId(SecurityUtils.getUser().getCompId());
      contract.setPartyB(SecurityUtils.getUser().getCompName());
      if (StrUtil.isEmpty(addDTO.getPartyA())){
         BusinessCustomer bc = businessCustomerMapper.selectById(addDTO.getPartyAId());
         if (ObjUtil.isNotNull(bc)){
            contract.setPartyA(bc.getCompanyName());
         }
      }
      contract.setPaidAmount(new BigDecimal("0"));
      contract.setBillingStatus("1");
      contract.setBillingAmout(new BigDecimal("0"));
      contract.setErpPushFlag("0");
      contract.setNickName(SecurityUtils.getUser().getNickname());
      if (StrUtil.equals(SecurityUtils.getUser().getCompId()+"",smj)||StrUtil.equals(SecurityUtils.getUser().getCompId()+"",smjsc)||
            StrUtil.equals(SecurityUtils.getUser().getCompId()+"",smjzt)){
         contract.setContractNo(generateSMJContractNo());
      }
      if (StrUtil.equals(SecurityUtils.getUser().getCompId()+"",sgb)){
         contract.setContractNo(generateGYBContractNo());
      }
      if (StrUtil.equals(SecurityUtils.getUser().getCompId()+"",ymj)){
         contract.setContractNo(generateYMJContractNo());
      }
      if (StrUtil.equals(SecurityUtils.getUser().getCompId()+"",tfgs)){
         contract.setContractNo(generateTFContractNo());
      }
      if (StrUtil.equals(SecurityUtils.getUser().getCompId()+"",jxc)){
         contract.setContractNo(generateJXCContractNo());
      }
      baseMapper.insert(contract);
      return R.ok();
   }
   @Override
   public R pushCenter(Long id) {
      Contract contract = baseMapper.selectById(id);
      List<ContractSubjectMatter> subjectMatterList=contractSubjectMatterMapper.selectList(Wrappers.<ContractSubjectMatter>lambdaQuery()
            .eq(ContractSubjectMatter::getContractId,id));
      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);
         }
      }
      return R.ok();
   }
}