订单绑定相关
This commit is contained in:
@@ -35,6 +35,6 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode CONTRACT_STATUS_NOT_CANCEL = new ErrorCode(1_027_000_020, "{}状态合同不允许作废");
|
ErrorCode CONTRACT_STATUS_NOT_CANCEL = new ErrorCode(1_027_000_020, "{}状态合同不允许作废");
|
||||||
ErrorCode AMOUNT_DISMANTLE_NOT_EXISTS = new ErrorCode(1_027_000_022, "资金拆分不存在");
|
ErrorCode AMOUNT_DISMANTLE_NOT_EXISTS = new ErrorCode(1_027_000_022, "资金拆分不存在");
|
||||||
ErrorCode CONTRACT_RECEIVE_SEND_NOT_EXISTS = new ErrorCode(1_027_000_021, "收发货规则不存在");
|
ErrorCode CONTRACT_RECEIVE_SEND_NOT_EXISTS = new ErrorCode(1_027_000_021, "收发货规则不存在");
|
||||||
ErrorCode PARAMETER_ID_EMPTY = new ErrorCode(1_027_000_023, "绑定的合同ID不能空");
|
ErrorCode PARAMETER_ID_EMPTY = new ErrorCode(1_027_000_023, "合同ID不能空");
|
||||||
ErrorCode PARAMETER_BUSINESS_TYPE_INVALID = new ErrorCode(1_027_000_024, "合同业务类型无效请参考字典(SPLY_BSN_TP)");
|
ErrorCode PARAMETER_BUSINESS_TYPE_INVALID = new ErrorCode(1_027_000_024, "合同业务类型无效请参考字典(SPLY_BSN_TP)");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -219,10 +219,10 @@ public class PurchaseOrderController implements BusinessControllerMarker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//无权限查询订单
|
//无权限查询订单
|
||||||
@PostMapping("/page-no-permission")
|
@GetMapping("/page-no-permission")
|
||||||
@Operation(summary = "无权限查询订单")
|
@Operation(summary = "无权限查询订单")
|
||||||
@PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:query')")
|
@PreAuthorize("@ss.hasAnyPermissions('base:purchase-order:query')")
|
||||||
public CommonResult<PageResult<PurchaseOrderRespVO>> pageOrderNoPermission(@RequestBody PurchaseOrderPageReqVO pageReqVO) {
|
public CommonResult<PageResult<PurchaseOrderRespVO>> pageOrderNoPermission(@Valid PurchaseOrderPageReqVO pageReqVO) {
|
||||||
PageResult<PurchaseOrderDO> pageResult = purchaseOrderService.pageOrderNoPermission(pageReqVO);
|
PageResult<PurchaseOrderDO> pageResult = purchaseOrderService.pageOrderNoPermission(pageReqVO);
|
||||||
return success( BeanUtils.toBean(pageResult, PurchaseOrderRespVO.class));
|
return success( BeanUtils.toBean(pageResult, PurchaseOrderRespVO.class));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,11 +31,8 @@ public interface ContractMainMapper extends BaseMapperX<ContractMainDO> {
|
|||||||
.orderByDesc(ContractMainDO::getCreateTime));
|
.orderByDesc(ContractMainDO::getCreateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
@CompanyDataPermissionIgnore
|
|
||||||
@DeptDataPermissionIgnore
|
|
||||||
default PageResult<ContractMainDO> selectContractPageNoPermission(ContractPageReqVO reqVO) {
|
default PageResult<ContractMainDO> selectContractPageNoPermission(ContractPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ContractMainDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ContractMainDO>()
|
||||||
.eq(ContractMainDO::getId, reqVO.getId())
|
|
||||||
.likeIfPresent(ContractMainDO::getContractName, reqVO.getContractName())
|
.likeIfPresent(ContractMainDO::getContractName, reqVO.getContractName())
|
||||||
.likeIfPresent(ContractMainDO::getContractPaperNumber, reqVO.getContractPaperNumber())
|
.likeIfPresent(ContractMainDO::getContractPaperNumber, reqVO.getContractPaperNumber())
|
||||||
.eqIfPresent(ContractMainDO::getDirection, reqVO.getDirection())
|
.eqIfPresent(ContractMainDO::getDirection, reqVO.getDirection())
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIg
|
|||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.zt.plat.framework.security.core.LoginUser;
|
import com.zt.plat.framework.security.core.LoginUser;
|
||||||
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
|
import com.zt.plat.framework.tenant.core.aop.TenantIgnore;
|
||||||
import com.zt.plat.framework.tenant.core.context.CompanyContextHolder;
|
import com.zt.plat.framework.tenant.core.context.CompanyContextHolder;
|
||||||
import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscBsnRelRespVO;
|
import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscBsnRelRespVO;
|
||||||
import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscBsnRelSaveReqVO;
|
import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscBsnRelSaveReqVO;
|
||||||
@@ -145,11 +146,17 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@CompanyDataPermissionIgnore
|
||||||
|
@DeptDataPermissionIgnore
|
||||||
|
@TenantIgnore
|
||||||
public PageResult<ContractMainDO> getPageNoPermission(ContractPageReqVO pageReqVO) {
|
public PageResult<ContractMainDO> getPageNoPermission(ContractPageReqVO pageReqVO) {
|
||||||
if (pageReqVO.getId() == null) {
|
if (pageReqVO.getId() == null) {
|
||||||
throw exception(PARAMETER_ID_EMPTY);
|
throw exception(PARAMETER_ID_EMPTY);
|
||||||
}
|
}
|
||||||
ContractMainDO contractMainDO = contractMainMapper.selectById(pageReqVO.getId());
|
ContractMainDO contractMainDO = contractMainMapper.selectById(pageReqVO.getId());
|
||||||
|
if (contractMainDO == null){
|
||||||
|
return PageResult.empty();
|
||||||
|
}
|
||||||
String businessType = VALID_RELATIONS.getOrDefault(contractMainDO.getBusinessType(), null);
|
String businessType = VALID_RELATIONS.getOrDefault(contractMainDO.getBusinessType(), null);
|
||||||
if (businessType == null) {
|
if (businessType == null) {
|
||||||
throw exception(PARAMETER_BUSINESS_TYPE_INVALID);
|
throw exception(PARAMETER_BUSINESS_TYPE_INVALID);
|
||||||
@@ -160,9 +167,11 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
if (visitCompanyCode.equals(contractMainDO.getErpPurchaseCompanyNumber())) {
|
if (visitCompanyCode.equals(contractMainDO.getErpPurchaseCompanyNumber())) {
|
||||||
//查乙方
|
//查乙方
|
||||||
pageReqVO.setErpSalesCompanyNumber(contractMainDO.getErpSalesCompanyNumber());
|
pageReqVO.setErpSalesCompanyNumber(contractMainDO.getErpSalesCompanyNumber());
|
||||||
|
pageReqVO.setErpPurchaseCompanyNumber(null);// 防止甲方条件拼接
|
||||||
} else if (visitCompanyCode.equals(contractMainDO.getErpSalesCompanyNumber())) {
|
} else if (visitCompanyCode.equals(contractMainDO.getErpSalesCompanyNumber())) {
|
||||||
//查甲方
|
//查甲方
|
||||||
pageReqVO.setErpPurchaseCompanyNumber(contractMainDO.getErpPurchaseCompanyNumber());
|
pageReqVO.setErpPurchaseCompanyNumber(contractMainDO.getErpPurchaseCompanyNumber());
|
||||||
|
pageReqVO.setErpSalesCompanyNumber(null); // 防止乙方方条件拼接
|
||||||
}
|
}
|
||||||
pageReqVO.setBusinessType(businessType);
|
pageReqVO.setBusinessType(businessType);
|
||||||
return contractMainMapper.selectContractPageNoPermission(pageReqVO);
|
return contractMainMapper.selectContractPageNoPermission(pageReqVO);
|
||||||
@@ -2097,6 +2106,7 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@CompanyDataPermissionIgnore
|
@CompanyDataPermissionIgnore
|
||||||
@DeptDataPermissionIgnore
|
@DeptDataPermissionIgnore
|
||||||
|
@TenantIgnore
|
||||||
public void relationContract(RelationContractVO relationContractVO) {
|
public void relationContract(RelationContractVO relationContractVO) {
|
||||||
//查询当前订单是否已经绑定订单了
|
//查询当前订单是否已经绑定订单了
|
||||||
ContractMainDO contractMainDO = contractMainMapper.selectById(relationContractVO.getContractId());
|
ContractMainDO contractMainDO = contractMainMapper.selectById(relationContractVO.getContractId());
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.zt.plat.framework.common.util.object.BeanUtils;
|
|||||||
import com.zt.plat.framework.datapermission.core.annotation.CompanyDataPermissionIgnore;
|
import com.zt.plat.framework.datapermission.core.annotation.CompanyDataPermissionIgnore;
|
||||||
import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore;
|
import com.zt.plat.framework.datapermission.core.annotation.DeptDataPermissionIgnore;
|
||||||
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
|
import com.zt.plat.framework.tenant.core.aop.TenantIgnore;
|
||||||
import com.zt.plat.module.base.api.materialinfomation.MaterialInfomationApi;
|
import com.zt.plat.module.base.api.materialinfomation.MaterialInfomationApi;
|
||||||
import com.zt.plat.module.base.api.materialinfomation.dto.MaterialInfomationPageReqDTO;
|
import com.zt.plat.module.base.api.materialinfomation.dto.MaterialInfomationPageReqDTO;
|
||||||
import com.zt.plat.module.base.api.materialinfomation.dto.MaterialInfomationRespDTO;
|
import com.zt.plat.module.base.api.materialinfomation.dto.MaterialInfomationRespDTO;
|
||||||
@@ -921,14 +922,24 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|||||||
@Override
|
@Override
|
||||||
@CompanyDataPermissionIgnore
|
@CompanyDataPermissionIgnore
|
||||||
@DeptDataPermissionIgnore
|
@DeptDataPermissionIgnore
|
||||||
|
@TenantIgnore
|
||||||
public PageResult<PurchaseOrderDO> pageOrderNoPermission(PurchaseOrderPageReqVO pageReqVO) {
|
public PageResult<PurchaseOrderDO> pageOrderNoPermission(PurchaseOrderPageReqVO pageReqVO) {
|
||||||
if (pageReqVO.getId() == null){
|
if (pageReqVO.getId() == null){
|
||||||
throw exception(PURCHASE_ORDER_ID_IS_NULL);
|
throw exception(PURCHASE_ORDER_ID_IS_NULL);
|
||||||
}
|
}
|
||||||
PurchaseOrderDO purchaseOrderDO = purchaseOrderMapper.selectById(pageReqVO.getId());
|
PurchaseOrderDO purchaseOrderDO = purchaseOrderMapper.selectById(pageReqVO.getId());
|
||||||
|
if (purchaseOrderDO == null){
|
||||||
|
return PageResult.empty();
|
||||||
|
}
|
||||||
ContractMainDO contractMainDO = contractMainMapper.selectOne(new LambdaQueryWrapper<ContractMainDO>()
|
ContractMainDO contractMainDO = contractMainMapper.selectOne(new LambdaQueryWrapper<ContractMainDO>()
|
||||||
.eq(ContractMainDO::getId, purchaseOrderDO.getContractNumber()));
|
.eq(ContractMainDO::getSystemContractNumber, purchaseOrderDO.getContractNumber()));
|
||||||
|
if (contractMainDO == null || contractMainDO.getRelatedContractId() == null){
|
||||||
|
return PageResult.empty();
|
||||||
|
}
|
||||||
ContractMainDO relatedContract = contractMainMapper.selectById(contractMainDO.getRelatedContractId());
|
ContractMainDO relatedContract = contractMainMapper.selectById(contractMainDO.getRelatedContractId());
|
||||||
|
if (relatedContract == null){
|
||||||
|
return PageResult.empty();
|
||||||
|
}
|
||||||
String splyBsnTp = VALID_RELATIONS.getOrDefault(purchaseOrderDO.getSplyBsnTp(), null); // 获取供应商业务类型
|
String splyBsnTp = VALID_RELATIONS.getOrDefault(purchaseOrderDO.getSplyBsnTp(), null); // 获取供应商业务类型
|
||||||
if (splyBsnTp == null){
|
if (splyBsnTp == null){
|
||||||
throw exception(PURCHASE_ORDER_ID_IS_EMPTY);
|
throw exception(PURCHASE_ORDER_ID_IS_EMPTY);
|
||||||
@@ -941,6 +952,7 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|||||||
@Override
|
@Override
|
||||||
@CompanyDataPermissionIgnore
|
@CompanyDataPermissionIgnore
|
||||||
@DeptDataPermissionIgnore
|
@DeptDataPermissionIgnore
|
||||||
|
@TenantIgnore
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void boundOrder(BoundOrderReqVO reqVO) {
|
public void boundOrder(BoundOrderReqVO reqVO) {
|
||||||
log.info("开始执行绑定订单操作,请求参数:{}", reqVO);
|
log.info("开始执行绑定订单操作,请求参数:{}", reqVO);
|
||||||
|
|||||||
Reference in New Issue
Block a user