diff --git a/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/enums/ErrorCodeConstants.java b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/enums/ErrorCodeConstants.java index b3edc42..bb50fb2 100644 --- a/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/enums/ErrorCodeConstants.java +++ b/zt-module-contract-order/zt-module-contract-order-api/src/main/java/com/zt/plat/module/contractorder/enums/ErrorCodeConstants.java @@ -30,4 +30,5 @@ public interface ErrorCodeConstants { ErrorCode CONTRACT_SUBMIT_ERP_FAIL = new ErrorCode(1_027_000_015, "合同提交erp失败:{}"); ErrorCode CONTRACT_UNKNOWN_OPERATE = new ErrorCode(1_027_000_016, "未知的操作"); ErrorCode CONTRACT_PARTNER_NOT_EXISTS = new ErrorCode(1_027_000_017, "客商信息不存在"); + ErrorCode CONTRACT_PUSH_FAIL = new ErrorCode(1_027_000_019, "推送合同失败:{}"); } diff --git a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/contract/ContractController.java b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/contract/ContractController.java index 2d79e74..0f8e1d4 100644 --- a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/contract/ContractController.java +++ b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/controller/admin/contract/ContractController.java @@ -5,7 +5,10 @@ import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; import com.zt.plat.framework.common.pojo.CommonResult; import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.util.object.BeanUtils; +import com.zt.plat.module.contractorder.api.ContractApi; import com.zt.plat.module.contractorder.api.vo.contract.*; +import com.zt.plat.module.contractorder.api.vo.contract.international.IntContract; +import com.zt.plat.module.contractorder.api.vo.contract.international.IntContractPageReq; import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractMainDO; import com.zt.plat.module.contractorder.service.contract.ContractService; import io.swagger.v3.oas.annotations.Operation; @@ -23,6 +26,7 @@ import java.util.List; import static com.zt.plat.framework.common.pojo.CommonResult.error; import static com.zt.plat.framework.common.pojo.CommonResult.success; +import static com.zt.plat.module.contractorder.enums.ErrorCodeConstants.CONTRACT_PUSH_FAIL; import static com.zt.plat.module.contractorder.enums.ErrorCodeConstants.CONTRACT_SUBMIT_ERP_FAIL; @Slf4j @@ -34,6 +38,8 @@ public class ContractController implements BusinessControllerMarker { @Resource private ContractService contractService; + @Resource + private ContractApi contractApi; @GetMapping("/page") @Operation(summary = "获得合同分页列表") @@ -186,4 +192,22 @@ public class ContractController implements BusinessControllerMarker { public CommonResult relation(@RequestBody RelationReqVo reqVo) { return success(contractService.relation(reqVo)); } + + @PostMapping("/push") + @Operation(summary = "国贸2.0系统推送合同") + @PreAuthorize("@ss.hasPermission('base:contract:create')") + CommonResult push(@Valid @RequestBody IntContract reqVO) { + try { + return contractApi.push(reqVO); + } catch (Exception e) { + return error(CONTRACT_PUSH_FAIL, e.getMessage()); + } + } + + @PostMapping("/logistics/list/page") + @Operation(summary = "国贸2.0系统合同分页查询") + @PreAuthorize("@ss.hasPermission('base:contract:query')") + CommonResult> logisticsListPage(IntContractPageReq pageReq) { + return contractApi.logisticsListPage(pageReq); + } } diff --git a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/contract/ContractServiceImpl.java b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/contract/ContractServiceImpl.java index f02f2c7..ab19798 100644 --- a/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/contract/ContractServiceImpl.java +++ b/zt-module-contract-order/zt-module-contract-order-server/src/main/java/com/zt/plat/module/contractorder/service/contract/ContractServiceImpl.java @@ -921,13 +921,9 @@ public class ContractServiceImpl implements ContractService { } // 更新合同主信息 - contractMainMapper.updateById(newContractMainDO); - // 模板实例ID更新为null - if (newContractMainDO.getInstanceId() == null) { - contractMainMapper.update(new LambdaUpdateWrapper<>(ContractMainDO.class) - .set(ContractMainDO::getInstanceId, null) - .eq(ContractMainDO::getId, newContractMainDO.getId())); - } + contractMainMapper.update(newContractMainDO, new LambdaUpdateWrapper<>(ContractMainDO.class) + .set(ContractMainDO::getInstanceId, newContractMainDO.getInstanceId()) + .eq(ContractMainDO::getId, newContractMainDO.getId())); if (DictEnum.BSE_CTRT_STS_IN_PROGRESS.getCode().equals(newContractMainDO.getStatus())) { // 执行中合同重新提交erp