Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -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<Boolean> relation(@RequestBody RelationReqVo 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);
|
||||
// 模板实例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
|
||||
|
||||
Reference in New Issue
Block a user