Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -30,4 +30,5 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode CONTRACT_SUBMIT_ERP_FAIL = new ErrorCode(1_027_000_015, "合同提交erp失败:{}");
|
ErrorCode CONTRACT_SUBMIT_ERP_FAIL = new ErrorCode(1_027_000_015, "合同提交erp失败:{}");
|
||||||
ErrorCode CONTRACT_UNKNOWN_OPERATE = new ErrorCode(1_027_000_016, "未知的操作");
|
ErrorCode CONTRACT_UNKNOWN_OPERATE = new ErrorCode(1_027_000_016, "未知的操作");
|
||||||
ErrorCode CONTRACT_PARTNER_NOT_EXISTS = new ErrorCode(1_027_000_017, "客商信息不存在");
|
ErrorCode CONTRACT_PARTNER_NOT_EXISTS = new ErrorCode(1_027_000_017, "客商信息不存在");
|
||||||
|
ErrorCode CONTRACT_PUSH_FAIL = new ErrorCode(1_027_000_019, "推送合同失败:{}");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.CommonResult;
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
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.*;
|
||||||
|
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.dal.dataobject.contract.ContractMainDO;
|
||||||
import com.zt.plat.module.contractorder.service.contract.ContractService;
|
import com.zt.plat.module.contractorder.service.contract.ContractService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
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.error;
|
||||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
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;
|
import static com.zt.plat.module.contractorder.enums.ErrorCodeConstants.CONTRACT_SUBMIT_ERP_FAIL;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@@ -34,6 +38,8 @@ public class ContractController implements BusinessControllerMarker {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ContractService contractService;
|
private ContractService contractService;
|
||||||
|
@Resource
|
||||||
|
private ContractApi contractApi;
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得合同分页列表")
|
@Operation(summary = "获得合同分页列表")
|
||||||
@@ -186,4 +192,22 @@ public class ContractController implements BusinessControllerMarker {
|
|||||||
public CommonResult<Boolean> relation(@RequestBody RelationReqVo reqVo) {
|
public CommonResult<Boolean> relation(@RequestBody RelationReqVo reqVo) {
|
||||||
return success(contractService.relation(reqVo));
|
return success(contractService.relation(reqVo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/push")
|
||||||
|
@Operation(summary = "国贸2.0系统推送合同")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:contract:create')")
|
||||||
|
CommonResult<Boolean> 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<PageResult<IntContract>> logisticsListPage(IntContractPageReq pageReq) {
|
||||||
|
return contractApi.logisticsListPage(pageReq);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -921,13 +921,9 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 更新合同主信息
|
// 更新合同主信息
|
||||||
contractMainMapper.updateById(newContractMainDO);
|
contractMainMapper.update(newContractMainDO, new LambdaUpdateWrapper<>(ContractMainDO.class)
|
||||||
// 模板实例ID更新为null
|
.set(ContractMainDO::getInstanceId, newContractMainDO.getInstanceId())
|
||||||
if (newContractMainDO.getInstanceId() == null) {
|
|
||||||
contractMainMapper.update(new LambdaUpdateWrapper<>(ContractMainDO.class)
|
|
||||||
.set(ContractMainDO::getInstanceId, null)
|
|
||||||
.eq(ContractMainDO::getId, newContractMainDO.getId()));
|
.eq(ContractMainDO::getId, newContractMainDO.getId()));
|
||||||
}
|
|
||||||
|
|
||||||
if (DictEnum.BSE_CTRT_STS_IN_PROGRESS.getCode().equals(newContractMainDO.getStatus())) {
|
if (DictEnum.BSE_CTRT_STS_IN_PROGRESS.getCode().equals(newContractMainDO.getStatus())) {
|
||||||
// 执行中合同重新提交erp
|
// 执行中合同重新提交erp
|
||||||
|
|||||||
Reference in New Issue
Block a user