Merge branch 'refs/heads/dev' into test
This commit is contained in:
@@ -28,8 +28,8 @@ public interface AccountMapper extends BaseMapperX<AccountDO> {
|
|||||||
.likeIfPresent(AccountDO::getCustomerName, reqVO.getCustomerName())
|
.likeIfPresent(AccountDO::getCustomerName, reqVO.getCustomerName())
|
||||||
.likeIfPresent(AccountDO::getCustomerNumber, reqVO.getCustomerNumber())
|
.likeIfPresent(AccountDO::getCustomerNumber, reqVO.getCustomerNumber())
|
||||||
.eqIfPresent(AccountDO::getIsEnable, reqVO.getIsEnable())
|
.eqIfPresent(AccountDO::getIsEnable, reqVO.getIsEnable())
|
||||||
.eqIfPresent(AccountDO::getAccountNumber, reqVO.getAccountNumber())
|
.likeIfPresent(AccountDO::getAccountNumber, reqVO.getAccountNumber())
|
||||||
.eqIfPresent(AccountDO::getTaxNumber, reqVO.getTaxNumber())
|
.likeIfPresent(AccountDO::getTaxNumber, reqVO.getTaxNumber())
|
||||||
.betweenIfPresent(AccountDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(AccountDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.orderByDesc(AccountDO::getId));
|
.orderByDesc(AccountDO::getId));
|
||||||
}
|
}
|
||||||
@@ -41,11 +41,11 @@ public interface AccountMapper extends BaseMapperX<AccountDO> {
|
|||||||
.likeIfPresent(AccountDO::getAddress, dto.getAddress())
|
.likeIfPresent(AccountDO::getAddress, dto.getAddress())
|
||||||
.likeIfPresent(AccountDO::getPhone, dto.getPhone())
|
.likeIfPresent(AccountDO::getPhone, dto.getPhone())
|
||||||
.eqIfPresent(AccountDO::getBankAccount, dto.getBankAccount())
|
.eqIfPresent(AccountDO::getBankAccount, dto.getBankAccount())
|
||||||
.eqIfPresent(AccountDO::getCustomerName, dto.getCustomerName())
|
.likeIfPresent(AccountDO::getCustomerName, dto.getCustomerName())
|
||||||
.eqIfPresent(AccountDO::getCustomerNumber, dto.getCustomerNumber())
|
.likeIfPresent(AccountDO::getCustomerNumber, dto.getCustomerNumber())
|
||||||
.eqIfPresent(AccountDO::getIsEnable, dto.getIsEnable())
|
.eqIfPresent(AccountDO::getIsEnable, dto.getIsEnable())
|
||||||
.eqIfPresent(AccountDO::getAccountNumber, dto.getAccountNumber())
|
.likeIfPresent(AccountDO::getAccountNumber, dto.getAccountNumber())
|
||||||
.eqIfPresent(AccountDO::getTaxNumber, dto.getTaxNumber())
|
.likeIfPresent(AccountDO::getTaxNumber, dto.getTaxNumber())
|
||||||
.orderByDesc(AccountDO::getId));
|
.orderByDesc(AccountDO::getId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -21,8 +21,8 @@ public interface CompanyRelativityMapper extends BaseMapperX<CompanyRelativityDO
|
|||||||
|
|
||||||
default PageResult<CompanyRelativityDO> selectPage(CompanyRelativityPageReqVO reqVO) {
|
default PageResult<CompanyRelativityDO> selectPage(CompanyRelativityPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<CompanyRelativityDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<CompanyRelativityDO>()
|
||||||
.eqIfPresent(CompanyRelativityDO::getErpNumber, reqVO.getErpNumber())
|
.likeIfPresent(CompanyRelativityDO::getErpNumber, reqVO.getErpNumber())
|
||||||
.eqIfPresent(CompanyRelativityDO::getNumber, reqVO.getNumber())
|
.likeIfPresent(CompanyRelativityDO::getNumber, reqVO.getNumber())
|
||||||
.betweenIfPresent(CompanyRelativityDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(CompanyRelativityDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.orderByDesc(CompanyRelativityDO::getId));
|
.orderByDesc(CompanyRelativityDO::getId));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,11 +21,11 @@ public interface ContactMapper extends BaseMapperX<ContactDO> {
|
|||||||
.likeIfPresent(ContactDO::getContact, reqVO.getContact())
|
.likeIfPresent(ContactDO::getContact, reqVO.getContact())
|
||||||
.likeIfPresent(ContactDO::getTel, reqVO.getTel())
|
.likeIfPresent(ContactDO::getTel, reqVO.getTel())
|
||||||
.likeIfPresent(ContactDO::getCustomerName, reqVO.getCustomerName())
|
.likeIfPresent(ContactDO::getCustomerName, reqVO.getCustomerName())
|
||||||
.eqIfPresent(ContactDO::getCustomerNumber, reqVO.getCustomerNumber())
|
.likeIfPresent(ContactDO::getCustomerNumber, reqVO.getCustomerNumber())
|
||||||
.eqIfPresent(ContactDO::getIsEnable, reqVO.getIsEnable())
|
.eqIfPresent(ContactDO::getIsEnable, reqVO.getIsEnable())
|
||||||
.eqIfPresent(ContactDO::getEmail, reqVO.getEmail())
|
.likeIfPresent(ContactDO::getEmail, reqVO.getEmail())
|
||||||
.eqIfPresent(ContactDO::getFax, reqVO.getFax())
|
.likeIfPresent(ContactDO::getFax, reqVO.getFax())
|
||||||
.eqIfPresent(ContactDO::getAddress, reqVO.getAddress())
|
.likeIfPresent(ContactDO::getAddress, reqVO.getAddress())
|
||||||
.betweenIfPresent(ContactDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(ContactDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.orderByDesc(ContactDO::getId));
|
.orderByDesc(ContactDO::getId));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,16 +17,16 @@ public interface FactoryMapper extends BaseMapperX<FactoryDO> {
|
|||||||
|
|
||||||
default PageResult<FactoryDO> selectPage(FactoryPageReqVO reqVO) {
|
default PageResult<FactoryDO> selectPage(FactoryPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<FactoryDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<FactoryDO>()
|
||||||
.eqIfPresent(FactoryDO::getCompanyNumber, reqVO.getCompanyNumber())
|
.likeIfPresent(FactoryDO::getCompanyNumber, reqVO.getCompanyNumber())
|
||||||
.likeIfPresent(FactoryDO::getCpnName, reqVO.getCpnName())
|
.likeIfPresent(FactoryDO::getCpnName, reqVO.getCpnName())
|
||||||
.eqIfPresent(FactoryDO::getErpCompanyNumber, reqVO.getErpCompanyNumber())
|
.likeIfPresent(FactoryDO::getErpCompanyNumber, reqVO.getErpCompanyNumber())
|
||||||
.likeIfPresent(FactoryDO::getErpCompanyName, reqVO.getErpCompanyName())
|
.likeIfPresent(FactoryDO::getErpCompanyName, reqVO.getErpCompanyName())
|
||||||
.likeIfPresent(FactoryDO::getName, reqVO.getName())
|
.likeIfPresent(FactoryDO::getName, reqVO.getName())
|
||||||
.eqIfPresent(FactoryDO::getNumber, reqVO.getNumber())
|
.likeIfPresent(FactoryDO::getNumber, reqVO.getNumber())
|
||||||
.betweenIfPresent(FactoryDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(FactoryDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.eqIfPresent(FactoryDO::getIsEnable, reqVO.getIsEnable())
|
.eqIfPresent(FactoryDO::getIsEnable, reqVO.getIsEnable())
|
||||||
.likeIfPresent(FactoryDO::getErpName, reqVO.getErpName())
|
.likeIfPresent(FactoryDO::getErpName, reqVO.getErpName())
|
||||||
.eqIfPresent(FactoryDO::getErpNumber, reqVO.getErpNumber())
|
.likeIfPresent(FactoryDO::getErpNumber, reqVO.getErpNumber())
|
||||||
.orderByDesc(FactoryDO::getId));
|
.orderByDesc(FactoryDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ public interface MaterialInfomationMapper extends BaseMapperX<MaterialInfomation
|
|||||||
|
|
||||||
default PageResult<MaterialInfomationDO> selectPage(MaterialInfomationPageReqVO reqVO, Collection<Long> infomationIds) {
|
default PageResult<MaterialInfomationDO> selectPage(MaterialInfomationPageReqVO reqVO, Collection<Long> infomationIds) {
|
||||||
return BaseMapperX.super.selectPage(reqVO, new LambdaQueryWrapperX<MaterialInfomationDO>()
|
return BaseMapperX.super.selectPage(reqVO, new LambdaQueryWrapperX<MaterialInfomationDO>()
|
||||||
.eqIfPresent(MaterialInfomationDO::getCode, reqVO.getCode())
|
.likeIfPresent(MaterialInfomationDO::getCode, reqVO.getCode())
|
||||||
.likeIfPresent(MaterialInfomationDO::getName, reqVO.getName())
|
.likeIfPresent(MaterialInfomationDO::getName, reqVO.getName())
|
||||||
.eqIfPresent(MaterialInfomationDO::getRemark, reqVO.getRemark())
|
.likeIfPresent(MaterialInfomationDO::getRemark, reqVO.getRemark())
|
||||||
.betweenIfPresent(MaterialInfomationDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(MaterialInfomationDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.inIfPresent(MaterialInfomationDO::getId, infomationIds)
|
.inIfPresent(MaterialInfomationDO::getId, infomationIds)
|
||||||
.orderByDesc(MaterialInfomationDO::getId));
|
.orderByDesc(MaterialInfomationDO::getId));
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public interface MaterialOtherMapper extends BaseMapperX<MaterialOtherDO> {
|
|||||||
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialOtherDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<MaterialOtherDO>()
|
||||||
.likeIfPresent(MaterialOtherDO::getMaterialNumber, reqVO.getMaterialNumber())
|
.likeIfPresent(MaterialOtherDO::getMaterialNumber, reqVO.getMaterialNumber())
|
||||||
.likeIfPresent(MaterialOtherDO::getMaterialName, reqVO.getMaterialName())
|
.likeIfPresent(MaterialOtherDO::getMaterialName, reqVO.getMaterialName())
|
||||||
.eqIfPresent(MaterialOtherDO::getErpMaterialNumber, reqVO.getErpMaterialNumber())
|
.likeIfPresent(MaterialOtherDO::getErpMaterialNumber, reqVO.getErpMaterialNumber())
|
||||||
.likeIfPresent(MaterialOtherDO::getErpMaterialName, reqVO.getErpMaterialName())
|
.likeIfPresent(MaterialOtherDO::getErpMaterialName, reqVO.getErpMaterialName())
|
||||||
.eqIfPresent(MaterialOtherDO::getUnit, reqVO.getUnit())
|
.eqIfPresent(MaterialOtherDO::getUnit, reqVO.getUnit())
|
||||||
.eqIfPresent(MaterialOtherDO::getAbbreviation, reqVO.getAbbreviation())
|
.eqIfPresent(MaterialOtherDO::getAbbreviation, reqVO.getAbbreviation())
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ public interface TaxMapper extends BaseMapperX<TaxDO> {
|
|||||||
.eqIfPresent(TaxDO::getType, reqVO.getType())
|
.eqIfPresent(TaxDO::getType, reqVO.getType())
|
||||||
.eqIfPresent(TaxDO::getCategory, reqVO.getCategory())
|
.eqIfPresent(TaxDO::getCategory, reqVO.getCategory())
|
||||||
.eqIfPresent(TaxDO::getTaxCoding, reqVO.getTaxCoding())
|
.eqIfPresent(TaxDO::getTaxCoding, reqVO.getTaxCoding())
|
||||||
.eqIfPresent(TaxDO::getRemark, reqVO.getRemark())
|
.likeIfPresent(TaxDO::getRemark, reqVO.getRemark())
|
||||||
.eqIfPresent(TaxDO::getTax, reqVO.getTax())
|
.eqIfPresent(TaxDO::getTax, reqVO.getTax())
|
||||||
.betweenIfPresent(TaxDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(TaxDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.eqIfPresent(TaxDO::getIsEnable, reqVO.getIsEnable())
|
.eqIfPresent(TaxDO::getIsEnable, reqVO.getIsEnable())
|
||||||
.eqIfPresent(TaxDO::getCustomerNumber, reqVO.getCustomerNumber())
|
.likeIfPresent(TaxDO::getCustomerNumber, reqVO.getCustomerNumber())
|
||||||
.likeIfPresent(TaxDO::getCustomerName, reqVO.getCustomerName())
|
.likeIfPresent(TaxDO::getCustomerName, reqVO.getCustomerName())
|
||||||
.orderByDesc(TaxDO::getId));
|
.orderByDesc(TaxDO::getId));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public interface WarehouseMapper extends BaseMapperX<WarehouseDO> {
|
|||||||
|
|
||||||
default PageResult<WarehouseDO> selectPage(WarehousePageReqVO reqVO) {
|
default PageResult<WarehouseDO> selectPage(WarehousePageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<WarehouseDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<WarehouseDO>()
|
||||||
.eqIfPresent(WarehouseDO::getFactoryNumber, reqVO.getFactoryNumber())
|
.likeIfPresent(WarehouseDO::getFactoryNumber, reqVO.getFactoryNumber())
|
||||||
.likeIfPresent(WarehouseDO::getCpnName, reqVO.getCpnName())
|
.likeIfPresent(WarehouseDO::getCpnName, reqVO.getCpnName())
|
||||||
.likeIfPresent(WarehouseDO::getErpFactoryName, reqVO.getErpFactoryName())
|
.likeIfPresent(WarehouseDO::getErpFactoryName, reqVO.getErpFactoryName())
|
||||||
.eqIfPresent(WarehouseDO::getErpFactoryNumber, reqVO.getErpFactoryNumber())
|
.eqIfPresent(WarehouseDO::getErpFactoryNumber, reqVO.getErpFactoryNumber())
|
||||||
@@ -26,8 +26,8 @@ public interface WarehouseMapper extends BaseMapperX<WarehouseDO> {
|
|||||||
.betweenIfPresent(WarehouseDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(WarehouseDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.likeIfPresent(WarehouseDO::getFactoryName, reqVO.getFactoryName())
|
.likeIfPresent(WarehouseDO::getFactoryName, reqVO.getFactoryName())
|
||||||
.eqIfPresent(WarehouseDO::getIsEnable, reqVO.getIsEnable())
|
.eqIfPresent(WarehouseDO::getIsEnable, reqVO.getIsEnable())
|
||||||
.eqIfPresent(WarehouseDO::getCompanyNumber, reqVO.getCompanyNumber())
|
.likeIfPresent(WarehouseDO::getCompanyNumber, reqVO.getCompanyNumber())
|
||||||
.eqIfPresent(WarehouseDO::getErpCoding, reqVO.getErpCoding())
|
.likeIfPresent(WarehouseDO::getErpCoding, reqVO.getErpCoding())
|
||||||
.likeIfPresent(WarehouseDO::getErpName, reqVO.getErpName())
|
.likeIfPresent(WarehouseDO::getErpName, reqVO.getErpName())
|
||||||
.orderByDesc(WarehouseDO::getId));
|
.orderByDesc(WarehouseDO::getId));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -393,12 +393,7 @@ public class TmplTpServiceImpl extends ServiceImpl<TmplTpMapper, TmplTpDO> imple
|
|||||||
String nodeId = node.getId().toString();
|
String nodeId = node.getId().toString();
|
||||||
String parentId = node.getPrnId() != null ? node.getPrnId().toString() : null;
|
String parentId = node.getPrnId() != null ? node.getPrnId().toString() : null;
|
||||||
|
|
||||||
// 如果是查询条件匹配的根节点
|
// 建立父子关系
|
||||||
if (rootIds.contains(nodeId)) {
|
|
||||||
roots.add(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果有父节点且父节点在当前节点集合中,建立父子关系
|
|
||||||
if (parentId != null && nodeMap.containsKey(parentId)) {
|
if (parentId != null && nodeMap.containsKey(parentId)) {
|
||||||
TmplTpTreeVO parent = nodeMap.get(parentId);
|
TmplTpTreeVO parent = nodeMap.get(parentId);
|
||||||
if (parent.getChildren() == null) {
|
if (parent.getChildren() == null) {
|
||||||
@@ -408,14 +403,26 @@ public class TmplTpServiceImpl extends ServiceImpl<TmplTpMapper, TmplTpDO> imple
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. 对所有节点的子节点进行排序
|
// 3. 只将匹配的节点(rootIds)且没有父节点在结果集中的,作为根节点
|
||||||
|
for (String rootId : rootIds) {
|
||||||
|
TmplTpTreeVO node = nodeMap.get(rootId);
|
||||||
|
if (node != null) {
|
||||||
|
String parentId = node.getPrnId() != null ? node.getPrnId().toString() : null;
|
||||||
|
// 如果父节点不在当前结果集中,则作为根节点
|
||||||
|
if (parentId == null || !nodeMap.containsKey(parentId)) {
|
||||||
|
roots.add(node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 对所有节点的子节点进行排序
|
||||||
nodeMap.values().forEach(node -> {
|
nodeMap.values().forEach(node -> {
|
||||||
if (node.getChildren() != null && !node.getChildren().isEmpty()) {
|
if (node.getChildren() != null && !node.getChildren().isEmpty()) {
|
||||||
node.getChildren().sort(Comparator.comparing(TmplTpTreeVO::getSrt));
|
node.getChildren().sort(Comparator.comparing(TmplTpTreeVO::getSrt));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 4. 对根节点排序
|
// 5. 对根节点排序
|
||||||
roots.sort(Comparator.comparing(TmplTpTreeVO::getSrt));
|
roots.sort(Comparator.comparing(TmplTpTreeVO::getSrt));
|
||||||
|
|
||||||
return roots;
|
return roots;
|
||||||
|
|||||||
@@ -17,4 +17,5 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode PURCHASE_ORDER_STATUS_ERROR = new ErrorCode(1_008_001_020, "非法的订单状态");
|
ErrorCode PURCHASE_ORDER_STATUS_ERROR = new ErrorCode(1_008_001_020, "非法的订单状态");
|
||||||
ErrorCode Sales_ORDER_NOT_EXISTS = new ErrorCode(1_008_000_030, "销售订单不存在");
|
ErrorCode Sales_ORDER_NOT_EXISTS = new ErrorCode(1_008_000_030, "销售订单不存在");
|
||||||
ErrorCode Sales_ORD_DTL_NOT_EXISTS = new ErrorCode(1_008_001_040, "销售订单明细不存在");
|
ErrorCode Sales_ORD_DTL_NOT_EXISTS = new ErrorCode(1_008_001_040, "销售订单明细不存在");
|
||||||
|
ErrorCode ORDER_DONT_SUBMIT = new ErrorCode(1_008_000_050, "该订单不支持审批");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ public enum OrderStatusEnum {
|
|||||||
// 执行中状态
|
// 执行中状态
|
||||||
IN_PROGRESS("IN_PROGRESS", "执行中"),
|
IN_PROGRESS("IN_PROGRESS", "执行中"),
|
||||||
// 关闭状态
|
// 关闭状态
|
||||||
CLOSED("CLOSE", "关闭");
|
CLOSED("CLOSE", "关闭"),
|
||||||
|
REJECTED("REJECT", "驳回");
|
||||||
|
|
||||||
/** 状态编码 */
|
/** 状态编码 */
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -21,7 +21,9 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import java.util.List;
|
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.framework.common.pojo.CommonResult.success;
|
||||||
|
import static com.zt.plat.module.contractorder.enums.ErrorCodeConstants.CONTRACT_SUBMIT_ERP_FAIL;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Tag(name = "管理后台 - 合同管理")
|
@Tag(name = "管理后台 - 合同管理")
|
||||||
@@ -146,7 +148,8 @@ public class ContractController implements BusinessControllerMarker {
|
|||||||
@Operation(summary = "提交ERP")
|
@Operation(summary = "提交ERP")
|
||||||
@PreAuthorize("@ss.hasPermission('base:contract:erp')")
|
@PreAuthorize("@ss.hasPermission('base:contract:erp')")
|
||||||
public CommonResult<JSONObject> submitErp(@RequestParam("id") Long id) {
|
public CommonResult<JSONObject> submitErp(@RequestParam("id") Long id) {
|
||||||
return success(contractService.submitErp(id));
|
JSONObject res = contractService.submitErp(id);
|
||||||
|
return res.getBool("success") ? success(res) : error(CONTRACT_SUBMIT_ERP_FAIL.getCode(), res.getStr("data"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/list/up-not-relation")
|
@GetMapping("/list/up-not-relation")
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ public interface PurchaseOrderMapper extends BaseMapperX<PurchaseOrderDO> {
|
|||||||
.eqIfPresent(PurchaseOrderDO::getPurchaseGroup, reqVO.getPurchaseGroup())
|
.eqIfPresent(PurchaseOrderDO::getPurchaseGroup, reqVO.getPurchaseGroup())
|
||||||
.eqIfPresent(PurchaseOrderDO::getCurrencyNumber, reqVO.getCurrencyNumber())
|
.eqIfPresent(PurchaseOrderDO::getCurrencyNumber, reqVO.getCurrencyNumber())
|
||||||
.eqIfPresent(PurchaseOrderDO::getExchangeRate, reqVO.getExchangeRate())
|
.eqIfPresent(PurchaseOrderDO::getExchangeRate, reqVO.getExchangeRate())
|
||||||
.eqIfPresent(PurchaseOrderDO::getPaperContractNumber, reqVO.getPaperContractNumber())
|
.likeIfPresent(PurchaseOrderDO::getPaperContractNumber, reqVO.getPaperContractNumber())
|
||||||
.eqIfPresent(PurchaseOrderDO::getAgreementNumber, reqVO.getAgreementNumber())
|
.likeIfPresent(PurchaseOrderDO::getAgreementNumber, reqVO.getAgreementNumber())
|
||||||
.eqIfPresent(PurchaseOrderDO::getRemark, reqVO.getRemark())
|
.eqIfPresent(PurchaseOrderDO::getRemark, reqVO.getRemark())
|
||||||
.eqIfPresent(PurchaseOrderDO::getAgentNumber, reqVO.getAgentNumber())
|
.eqIfPresent(PurchaseOrderDO::getAgentNumber, reqVO.getAgentNumber())
|
||||||
.likeIfPresent(PurchaseOrderDO::getAgentName, reqVO.getAgentName())
|
.likeIfPresent(PurchaseOrderDO::getAgentName, reqVO.getAgentName())
|
||||||
@@ -49,7 +49,7 @@ public interface PurchaseOrderMapper extends BaseMapperX<PurchaseOrderDO> {
|
|||||||
.eqIfPresent(PurchaseOrderDO::getMaterialNumber, reqVO.getMaterialNumber())
|
.eqIfPresent(PurchaseOrderDO::getMaterialNumber, reqVO.getMaterialNumber())
|
||||||
.likeIfPresent(PurchaseOrderDO::getMaterialName, reqVO.getMaterialName())
|
.likeIfPresent(PurchaseOrderDO::getMaterialName, reqVO.getMaterialName())
|
||||||
.likeIfPresent(PurchaseOrderDO::getContractName, reqVO.getContractName())
|
.likeIfPresent(PurchaseOrderDO::getContractName, reqVO.getContractName())
|
||||||
.eqIfPresent(PurchaseOrderDO::getTenantNumber, reqVO.getTenantNumber())
|
.likeIfPresent(PurchaseOrderDO::getTenantNumber, reqVO.getTenantNumber())
|
||||||
.betweenIfPresent(PurchaseOrderDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(PurchaseOrderDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.eqIfPresent(PurchaseOrderDO::getErpPurchaseCompanyNumber, reqVO.getErpPurchaseCompanyNumber())
|
.eqIfPresent(PurchaseOrderDO::getErpPurchaseCompanyNumber, reqVO.getErpPurchaseCompanyNumber())
|
||||||
.likeIfPresent(PurchaseOrderDO::getErpPurchaseCompanyName, reqVO.getErpPurchaseCompanyName())
|
.likeIfPresent(PurchaseOrderDO::getErpPurchaseCompanyName, reqVO.getErpPurchaseCompanyName())
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.zt.plat.module.contractorder.service.contract;
|
|||||||
import cn.hutool.json.JSONArray;
|
import cn.hutool.json.JSONArray;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
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;
|
||||||
@@ -917,16 +918,23 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
if (DictEnum.BSE_CTRT_STS_PUSH_ERROR.getCode().equals(oldContractMainDO.getStatus())) {
|
if (DictEnum.BSE_CTRT_STS_PUSH_ERROR.getCode().equals(oldContractMainDO.getStatus())) {
|
||||||
// “推送失败”的状态编辑后状态变为“待推送”
|
// “推送失败”的状态编辑后状态变为“待推送”
|
||||||
newContractMainDO.setStatus(DictEnum.BSE_CTRT_STS_WAIT_PUSH.getCode());
|
newContractMainDO.setStatus(DictEnum.BSE_CTRT_STS_WAIT_PUSH.getCode());
|
||||||
} else if (DictEnum.BSE_CTRT_STS_REJECTED.getCode().equals(oldContractMainDO.getStatus())
|
|
||||||
|| DictEnum.BSE_CTRT_STS_IN_PROGRESS.getCode().equals(oldContractMainDO.getStatus())) {
|
|
||||||
// 其它状态编辑后都为“待审核”
|
|
||||||
newContractMainDO.setStatus(DictEnum.BSE_CTRT_STS_WAIT_AUDIT.getCode());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新合同主信息
|
// 更新合同主信息
|
||||||
int updateNum = contractMainMapper.updateById(newContractMainDO);
|
contractMainMapper.updateById(newContractMainDO);
|
||||||
|
// 模板实例ID更新为null
|
||||||
|
if (newContractMainDO.getInstanceId() == null) {
|
||||||
|
contractMainMapper.update(new LambdaUpdateWrapper<>(ContractMainDO.class)
|
||||||
|
.set(ContractMainDO::getInstanceId, null)
|
||||||
|
.eq(ContractMainDO::getId, newContractMainDO.getId()));
|
||||||
|
}
|
||||||
|
|
||||||
return updateNum > 0;
|
if (DictEnum.BSE_CTRT_STS_IN_PROGRESS.getCode().equals(newContractMainDO.getStatus())) {
|
||||||
|
// 执行中合同重新提交erp
|
||||||
|
submitErp(newContractMainDO.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -944,7 +952,8 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 合同状态校验
|
// 合同状态校验
|
||||||
if (!DictEnum.BSE_CTRT_STS_DRAFT.getCode().equals(contractMainDO.getStatus())) {
|
if (!(DictEnum.BSE_CTRT_STS_DRAFT.getCode().equals(contractMainDO.getStatus())
|
||||||
|
|| DictEnum.BSE_CTRT_STS_REJECTED.getCode().equals(contractMainDO.getStatus()))) {
|
||||||
String msg = id.toString()
|
String msg = id.toString()
|
||||||
+ ":"
|
+ ":"
|
||||||
+ CONTRACT_STATUS_NOT_DELETE.getMsg()
|
+ CONTRACT_STATUS_NOT_DELETE.getMsg()
|
||||||
@@ -1025,7 +1034,7 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
|
|
||||||
// 合同状态校验
|
// 合同状态校验
|
||||||
if (!(DictEnum.BSE_CTRT_STS_DRAFT.getCode().equals(contractMainDO.getStatus())
|
if (!(DictEnum.BSE_CTRT_STS_DRAFT.getCode().equals(contractMainDO.getStatus())
|
||||||
|| DictEnum.BSE_CTRT_STS_WAIT_AUDIT.getCode().equals(contractMainDO.getStatus()))) {
|
|| DictEnum.BSE_CTRT_STS_REJECTED.getCode().equals(contractMainDO.getStatus()))) {
|
||||||
|
|
||||||
throw exception(CONTRACT_STATUS_NOT_SUBMIT_APPROVAL,
|
throw exception(CONTRACT_STATUS_NOT_SUBMIT_APPROVAL,
|
||||||
DictEnum.getByCodeAndType(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel());
|
DictEnum.getByCodeAndType(contractMainDO.getStatus(), DictTypeConstants.BSE_CTRT_STS).getLabel());
|
||||||
@@ -1128,6 +1137,33 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
badrDto.setTaskId(undoTask.getId()); // 当前审核任务节点id
|
badrDto.setTaskId(undoTask.getId()); // 当前审核任务节点id
|
||||||
BpmApprovalDetailRespDTO approvalDetail = bpmProcessInstanceApi.getApprovalDetail(SecurityFrameworkUtils.getLoginUserId(), badrDto).getData();
|
BpmApprovalDetailRespDTO approvalDetail = bpmProcessInstanceApi.getApprovalDetail(SecurityFrameworkUtils.getLoginUserId(), badrDto).getData();
|
||||||
|
|
||||||
|
// 需要调用bpm 审核接口更新审批中的状态
|
||||||
|
if (DictEnum.BSE_CTRT_STS_WAIT_PUSH.getCode().equals(reqVO.getStatus()) && ObjectUtils.isNotEmpty(undoTask)) {
|
||||||
|
if (approvalDetail.getStatus().equals(BpmProcessInstanceStatusEnum.RUNNING.getStatus())) {
|
||||||
|
BpmTaskApproveReqDTO btarDto = new BpmTaskApproveReqDTO();
|
||||||
|
btarDto.setId(undoTask.getId());
|
||||||
|
btarDto.setReason(reqVO.getReviewOpinion());
|
||||||
|
bpmProcessInstanceApi.approveTask(btarDto);
|
||||||
|
}
|
||||||
|
} else if (DictEnum.BSE_CTRT_STS_REJECTED.getCode().equals(reqVO.getStatus()) && ObjectUtils.isNotEmpty(undoTask)) {
|
||||||
|
if (approvalDetail.getStatus().equals(BpmProcessInstanceStatusEnum.RUNNING.getStatus())) {
|
||||||
|
BpmTaskRejectReqDTO btrrDto = new BpmTaskRejectReqDTO();
|
||||||
|
btrrDto.setId(undoTask.getId());
|
||||||
|
btrrDto.setReason(reqVO.getReviewOpinion());
|
||||||
|
bpmProcessInstanceApi.rejectTask(btrrDto);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取当前流程正在审批的任务节点
|
||||||
|
taskList = bpmTaskApi.getTaskListByProcessInstanceId(contractMainDO.getProcessInstanceId()).getData();
|
||||||
|
undoTask = taskList.get(taskList.size() - 1);
|
||||||
|
|
||||||
|
// 判断是否流程已经通过、驳回
|
||||||
|
badrDto = new BpmApprovalDetailReqDTO();
|
||||||
|
badrDto.setProcessInstanceId(contractMainDO.getProcessInstanceId()); // 流程实例id
|
||||||
|
badrDto.setTaskId(undoTask.getId()); // 当前审核任务节点id
|
||||||
|
approvalDetail = bpmProcessInstanceApi.getApprovalDetail(SecurityFrameworkUtils.getLoginUserId(), badrDto).getData();
|
||||||
|
|
||||||
// 更新合同状态,状态需要根据流程的状态进行判断
|
// 更新合同状态,状态需要根据流程的状态进行判断
|
||||||
contractMainDO.setReviewOpinion(reqVO.getReviewOpinion());
|
contractMainDO.setReviewOpinion(reqVO.getReviewOpinion());
|
||||||
if (approvalDetail.getStatus().equals(BpmProcessInstanceStatusEnum.NOT_START.getStatus())) {
|
if (approvalDetail.getStatus().equals(BpmProcessInstanceStatusEnum.NOT_START.getStatus())) {
|
||||||
@@ -1147,23 +1183,6 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
}
|
}
|
||||||
contractMainMapper.updateById(contractMainDO);
|
contractMainMapper.updateById(contractMainDO);
|
||||||
|
|
||||||
// 需要调用bpm 审核接口更新审批中的状态
|
|
||||||
if (DictEnum.BSE_CTRT_STS_WAIT_PUSH.getCode().equals(reqVO.getStatus()) && ObjectUtils.isNotEmpty(undoTask)) {
|
|
||||||
if (approvalDetail.getStatus().equals(BpmProcessInstanceStatusEnum.RUNNING.getStatus())) {
|
|
||||||
BpmTaskApproveReqDTO btarDto = new BpmTaskApproveReqDTO();
|
|
||||||
btarDto.setId(undoTask.getId());
|
|
||||||
btarDto.setReason(reqVO.getReviewOpinion());
|
|
||||||
bpmProcessInstanceApi.approveTask(btarDto);
|
|
||||||
}
|
|
||||||
} else if (DictEnum.BSE_CTRT_STS_REJECTED.getCode().equals(reqVO.getStatus()) && ObjectUtils.isNotEmpty(undoTask)) {
|
|
||||||
if (approvalDetail.getStatus().equals(BpmProcessInstanceStatusEnum.RUNNING.getStatus())) {
|
|
||||||
BpmTaskRejectReqDTO btrrDto = new BpmTaskRejectReqDTO();
|
|
||||||
btrrDto.setId(undoTask.getId());
|
|
||||||
btrrDto.setReason(reqVO.getReviewOpinion());
|
|
||||||
bpmProcessInstanceApi.rejectTask(btrrDto);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.zt.plat.module.bpm.api.task.BpmProcessInstanceApi;
|
|||||||
import com.zt.plat.module.bpm.api.task.BpmTaskApi;
|
import com.zt.plat.module.bpm.api.task.BpmTaskApi;
|
||||||
import com.zt.plat.module.bpm.api.task.dto.*;
|
import com.zt.plat.module.bpm.api.task.dto.*;
|
||||||
import com.zt.plat.module.bpm.enums.task.BpmProcessInstanceStatusEnum;
|
import com.zt.plat.module.bpm.enums.task.BpmProcessInstanceStatusEnum;
|
||||||
|
import com.zt.plat.module.bpm.enums.task.BpmTaskStatusEnum;
|
||||||
import com.zt.plat.module.contractorder.api.vo.contract.ContractRespVO;
|
import com.zt.plat.module.contractorder.api.vo.contract.ContractRespVO;
|
||||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*;
|
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*;
|
||||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.SystemRelativityDO;
|
import com.zt.plat.module.contractorder.dal.dataobject.contract.SystemRelativityDO;
|
||||||
@@ -40,6 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
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;
|
||||||
@@ -92,11 +94,11 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|||||||
public PurchaseOrderRespVO createPurchaseOrder(PurchaseOrderSaveReqVO createReqVO) {
|
public PurchaseOrderRespVO createPurchaseOrder(PurchaseOrderSaveReqVO createReqVO) {
|
||||||
// 插入
|
// 插入
|
||||||
PurchaseOrderDO purchaseOrder = BeanUtils.toBean(createReqVO, PurchaseOrderDO.class);
|
PurchaseOrderDO purchaseOrder = BeanUtils.toBean(createReqVO, PurchaseOrderDO.class);
|
||||||
// if (Objects.equals(createReqVO.getIsPush(), 0)) {
|
if (Objects.equals(createReqVO.getIsPush(), 0)) {
|
||||||
purchaseOrder.setStatus(OrderStatusEnum.DRAFT.getCode()); //设置初始状态
|
purchaseOrder.setStatus(OrderStatusEnum.DRAFT.getCode()); //设置初始状态
|
||||||
// } else {
|
} else {
|
||||||
// purchaseOrder.setStatus(OrderStatusEnum.TO_SUBMIT_ERP.getCode());
|
purchaseOrder.setStatus(OrderStatusEnum.TO_SUBMIT_ERP.getCode());
|
||||||
// }
|
}
|
||||||
//生成订单号
|
//生成订单号
|
||||||
String orderNumber = generateOrderNumber(purchaseOrder.getMtrlTp());
|
String orderNumber = generateOrderNumber(purchaseOrder.getMtrlTp());
|
||||||
purchaseOrder.setSystemOrderNumber(orderNumber);
|
purchaseOrder.setSystemOrderNumber(orderNumber);
|
||||||
@@ -191,6 +193,9 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|||||||
if (ObjectUtils.isEmpty(purchaseOrderDO)) {
|
if (ObjectUtils.isEmpty(purchaseOrderDO)) {
|
||||||
throw exception(ORDER_ID_NOT_EXISTS);
|
throw exception(ORDER_ID_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
|
if (purchaseOrderDO.getIsPush()==0) {
|
||||||
|
throw exception(ORDER_DONT_SUBMIT);
|
||||||
|
}
|
||||||
AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(SecurityFrameworkUtils.getLoginUserId()).getData();
|
AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(SecurityFrameworkUtils.getLoginUserId()).getData();
|
||||||
if (ObjectUtils.isEmpty(purchaseOrderDO.getProcessInstanceId())) {
|
if (ObjectUtils.isEmpty(purchaseOrderDO.getProcessInstanceId())) {
|
||||||
BpmProcessInstanceCreateReqDTO pidto = new BpmProcessInstanceCreateReqDTO();
|
BpmProcessInstanceCreateReqDTO pidto = new BpmProcessInstanceCreateReqDTO();
|
||||||
@@ -554,53 +559,61 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|||||||
return sequenceApi.getNextSequence("PURCHASE_ORDER_NUMBER", null, null).getData();
|
return sequenceApi.getNextSequence("PURCHASE_ORDER_NUMBER", null, null).getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
@Transactional(rollbackFor=Exception.class)
|
// @Transactional(rollbackFor=Exception.class)
|
||||||
public boolean orderPassReject(PurchaseorderReqVO purchaseorderReqVO) {
|
// public boolean orderPassReject(PurchaseorderReqVO purchaseorderReqVO) {
|
||||||
PurchaseOrderDO purchaseOrderDO = purchaseOrderMapper.selectById(purchaseorderReqVO.getId());
|
// PurchaseOrderDO purchaseOrderDO = purchaseOrderMapper.selectById(purchaseorderReqVO.getId());
|
||||||
if (ObjectUtils.isEmpty(purchaseOrderDO)) {
|
// if (ObjectUtils.isEmpty(purchaseOrderDO)) {
|
||||||
throw exception(PURCHASE_ORDER_NOT_EXISTS);
|
// throw exception(PURCHASE_ORDER_NOT_EXISTS);
|
||||||
}
|
// }
|
||||||
// 获取当前流程正在审批的任务节点
|
// // 获取当前流程正在审批的任务节点
|
||||||
List<BpmTaskRespDTO> taskList = bpmTaskApi.getTaskListByProcessInstanceId(purchaseOrderDO.getProcessInstanceId()).getData();
|
// List<BpmTaskRespDTO> taskList = bpmTaskApi.getTaskListByProcessInstanceId(purchaseOrderDO.getProcessInstanceId()).getData();
|
||||||
BpmTaskRespDTO undoTask = taskList.get(taskList.size() - 1);
|
// BpmTaskRespDTO undoTask = taskList.get(taskList.size() - 1);
|
||||||
|
//
|
||||||
|
// // 判断是否流程已经通过、驳回
|
||||||
|
// BpmApprovalDetailReqDTO badrDto = new BpmApprovalDetailReqDTO();
|
||||||
|
// badrDto.setProcessInstanceId(purchaseOrderDO.getProcessInstanceId()); // 流程实例id
|
||||||
|
// badrDto.setTaskId(undoTask.getId()); // 当前审核任务节点id
|
||||||
|
// BpmApprovalDetailRespDTO approvalDetail = bpmProcessInstanceApi.getApprovalDetail(SecurityFrameworkUtils.getLoginUserId(), badrDto).getData();
|
||||||
|
// //如果审核通过
|
||||||
|
// if ("WAIT_PUSH".equals(purchaseorderReqVO.getStatus())) {
|
||||||
|
// purchaseOrderDO.setStatus(getStatusByBpmProcessInstanceCode(approvalDetail.getStatus()));
|
||||||
|
// } else {
|
||||||
|
// //如果审核不通过
|
||||||
|
// purchaseOrderDO.setStatus(OrderStatusEnum.DRAFT.getCode());
|
||||||
|
// }
|
||||||
|
// //设置审核意见
|
||||||
|
// purchaseOrderDO.setReviewOpinion(purchaseorderReqVO.getReviewOpinion());
|
||||||
|
// if (ObjectUtils.isNotEmpty(undoTask)) {
|
||||||
|
// purchaseOrderDO.setTaskId(undoTask.getId());
|
||||||
|
// }
|
||||||
|
// purchaseOrderMapper.updateById(purchaseOrderDO); //更新状态
|
||||||
|
// // 需要调用bpm 审核接口更新审批中的状态
|
||||||
|
// if (DictEnum.BSE_CTRT_STS_WAIT_PUSH.getCode().equals(purchaseorderReqVO.getStatus()) && ObjectUtils.isNotEmpty(undoTask)) {
|
||||||
|
// if (approvalDetail.getStatus().equals(BpmProcessInstanceStatusEnum.RUNNING.getStatus())) {
|
||||||
|
// BpmTaskApproveReqDTO btarDto = new BpmTaskApproveReqDTO();
|
||||||
|
// btarDto.setId(undoTask.getId());
|
||||||
|
// btarDto.setReason(purchaseorderReqVO.getReviewOpinion());
|
||||||
|
// CommonResult<Boolean> booleanCommonResult = bpmProcessInstanceApi.approveTask(btarDto);
|
||||||
|
// if (booleanCommonResult.isError()) {
|
||||||
|
// throw new RuntimeException(booleanCommonResult.getMsg());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } else if (DictEnum.BSE_CTRT_STS_REJECTED.getCode().equals(purchaseorderReqVO.getStatus()) && ObjectUtils.isNotEmpty(undoTask)) {
|
||||||
|
// if (approvalDetail.getStatus().equals(BpmProcessInstanceStatusEnum.RUNNING.getStatus())) {
|
||||||
|
// BpmTaskRejectReqDTO btrrDto = new BpmTaskRejectReqDTO();
|
||||||
|
// btrrDto.setId(undoTask.getId());
|
||||||
|
// btrrDto.setReason(purchaseorderReqVO.getReviewOpinion());
|
||||||
|
// CommonResult<Boolean> booleanCommonResult = bpmProcessInstanceApi.rejectTask(btrrDto);
|
||||||
|
// if (booleanCommonResult.isError()) {
|
||||||
|
// throw new RuntimeException(booleanCommonResult.getMsg());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
// 判断是否流程已经通过、驳回
|
|
||||||
BpmApprovalDetailReqDTO badrDto = new BpmApprovalDetailReqDTO();
|
|
||||||
badrDto.setProcessInstanceId(purchaseOrderDO.getProcessInstanceId()); // 流程实例id
|
|
||||||
badrDto.setTaskId(undoTask.getId()); // 当前审核任务节点id
|
|
||||||
BpmApprovalDetailRespDTO approvalDetail = bpmProcessInstanceApi.getApprovalDetail(SecurityFrameworkUtils.getLoginUserId(), badrDto).getData();
|
|
||||||
//如果审核通过
|
|
||||||
if ("WAIT_PUSH".equals(purchaseorderReqVO.getStatus())) {
|
|
||||||
purchaseOrderDO.setStatus(OrderStatusEnum.TO_SUBMIT_ERP.getCode());
|
|
||||||
} else {
|
|
||||||
//如果审核不通过
|
|
||||||
purchaseOrderDO.setStatus(OrderStatusEnum.DRAFT.getCode());
|
|
||||||
}
|
|
||||||
//设置审核意见
|
|
||||||
purchaseOrderDO.setReviewOpinion(purchaseorderReqVO.getReviewOpinion());
|
|
||||||
if (ObjectUtils.isNotEmpty(undoTask)) {
|
|
||||||
purchaseOrderDO.setTaskId(undoTask.getId());
|
|
||||||
}
|
|
||||||
purchaseOrderMapper.updateById(purchaseOrderDO); //更新状态
|
|
||||||
// 需要调用bpm 审核接口更新审批中的状态
|
|
||||||
if (DictEnum.BSE_CTRT_STS_WAIT_PUSH.getCode().equals(purchaseorderReqVO.getStatus()) && ObjectUtils.isNotEmpty(undoTask)) {
|
|
||||||
if (approvalDetail.getStatus().equals(BpmProcessInstanceStatusEnum.RUNNING.getStatus())) {
|
|
||||||
BpmTaskApproveReqDTO btarDto = new BpmTaskApproveReqDTO();
|
|
||||||
btarDto.setId(undoTask.getId());
|
|
||||||
btarDto.setReason(purchaseorderReqVO.getReviewOpinion());
|
|
||||||
bpmProcessInstanceApi.approveTask(btarDto);
|
|
||||||
}
|
|
||||||
} else if (DictEnum.BSE_CTRT_STS_REJECTED.getCode().equals(purchaseorderReqVO.getStatus()) && ObjectUtils.isNotEmpty(undoTask)) {
|
|
||||||
if (approvalDetail.getStatus().equals(BpmProcessInstanceStatusEnum.RUNNING.getStatus())) {
|
|
||||||
BpmTaskRejectReqDTO btrrDto = new BpmTaskRejectReqDTO();
|
|
||||||
btrrDto.setId(undoTask.getId());
|
|
||||||
btrrDto.setReason(purchaseorderReqVO.getReviewOpinion());
|
|
||||||
bpmProcessInstanceApi.rejectTask(btrrDto);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DownOrUpOrderRespVO> getOrderByOrderIdAndType(DownOrUpOrderReqVO reqVO) {
|
public List<DownOrUpOrderRespVO> getOrderByOrderIdAndType(DownOrUpOrderReqVO reqVO) {
|
||||||
@@ -687,4 +700,90 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|||||||
public List<PurchaseOrderDO> getOrdersByIds(List<String> ids) {
|
public List<PurchaseOrderDO> getOrdersByIds(List<String> ids) {
|
||||||
return purchaseOrderMapper.selectByIds(ids);
|
return purchaseOrderMapper.selectByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor=Exception.class)
|
||||||
|
public boolean orderPassReject(PurchaseorderReqVO purchaseorderReqVO) {
|
||||||
|
// 查询采购单
|
||||||
|
PurchaseOrderDO purchaseOrderDO = purchaseOrderMapper.selectById(purchaseorderReqVO.getId());
|
||||||
|
if (ObjectUtils.isEmpty(purchaseOrderDO)) {
|
||||||
|
throw exception(PURCHASE_ORDER_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取当前流程的所有任务节点
|
||||||
|
List<BpmTaskRespDTO> taskList = bpmTaskApi.getTaskListByProcessInstanceId(purchaseOrderDO.getProcessInstanceId()).getData();
|
||||||
|
|
||||||
|
// 筛选出当前待处理的任务(未结束的任务)
|
||||||
|
BpmTaskRespDTO undoTask = taskList.stream()
|
||||||
|
.filter(task -> task.getEndTime() == null)
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
|
||||||
|
if (ObjectUtils.isEmpty(undoTask)) {
|
||||||
|
throw new RuntimeException("未找到待审批的任务节点");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 先调用BPM审批接口,再更新本地状态
|
||||||
|
if (DictEnum.BSE_CTRT_STS_WAIT_PUSH.getCode().equals(purchaseorderReqVO.getStatus())) {
|
||||||
|
// 审批通过
|
||||||
|
BpmTaskApproveReqDTO btarDto = new BpmTaskApproveReqDTO();
|
||||||
|
btarDto.setId(undoTask.getId());
|
||||||
|
btarDto.setReason(purchaseorderReqVO.getReviewOpinion());
|
||||||
|
CommonResult<Boolean> result = bpmProcessInstanceApi.approveTask(btarDto);
|
||||||
|
if (result.isError()) {
|
||||||
|
throw new RuntimeException(result.getMsg());
|
||||||
|
}
|
||||||
|
} else if (DictEnum.BSE_CTRT_STS_REJECTED.getCode().equals(purchaseorderReqVO.getStatus())) {
|
||||||
|
// 审批驳回
|
||||||
|
BpmTaskRejectReqDTO btrrDto = new BpmTaskRejectReqDTO();
|
||||||
|
btrrDto.setId(undoTask.getId());
|
||||||
|
btrrDto.setReason(purchaseorderReqVO.getReviewOpinion());
|
||||||
|
CommonResult<Boolean> result = bpmProcessInstanceApi.rejectTask(btrrDto);
|
||||||
|
if (result.isError()) {
|
||||||
|
throw new RuntimeException(result.getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用BPM接口后,查询最新的审批详情
|
||||||
|
BpmApprovalDetailReqDTO badrDto = new BpmApprovalDetailReqDTO();
|
||||||
|
badrDto.setProcessInstanceId(purchaseOrderDO.getProcessInstanceId());
|
||||||
|
badrDto.setTaskId(undoTask.getId());
|
||||||
|
BpmApprovalDetailRespDTO approvalDetail = bpmProcessInstanceApi.getApprovalDetail(SecurityFrameworkUtils.getLoginUserId(), badrDto).getData();
|
||||||
|
|
||||||
|
// 使用统一方法转换状态
|
||||||
|
purchaseOrderDO.setStatus(getStatusByBpmProcessInstanceCode(approvalDetail.getStatus()));
|
||||||
|
purchaseOrderDO.setReviewOpinion(purchaseorderReqVO.getReviewOpinion());
|
||||||
|
purchaseOrderDO.setTaskId(undoTask.getId());
|
||||||
|
|
||||||
|
purchaseOrderMapper.updateById(purchaseOrderDO);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getStatusByBpmProcessInstanceCode(Integer code) {
|
||||||
|
log.debug("转换BPM状态码 - 输入码: {}", code);
|
||||||
|
return Optional.ofNullable(code)
|
||||||
|
.map(c -> switch (c) {
|
||||||
|
case -1, 3, 4 -> {
|
||||||
|
log.debug("BPM状态码 {} 转换为: {}", c, OrderStatusEnum.REJECTED.getCode());
|
||||||
|
yield OrderStatusEnum.REJECTED.getCode();
|
||||||
|
}
|
||||||
|
case 1 -> {
|
||||||
|
log.debug("BPM状态码 {} 转换为: {}", c, OrderStatusEnum.APPROVING.getCode());
|
||||||
|
yield OrderStatusEnum.APPROVING.getCode();
|
||||||
|
}
|
||||||
|
case 2 -> {
|
||||||
|
log.debug("BPM状态码 {} 转换为: {}", c, OrderStatusEnum.TO_SUBMIT_ERP.getCode());
|
||||||
|
yield OrderStatusEnum.TO_SUBMIT_ERP.getCode();
|
||||||
|
}
|
||||||
|
default -> {
|
||||||
|
log.error("未定义的BPM状态码: {}", c);
|
||||||
|
throw new IllegalArgumentException("未定义的BPM状态码:" + c);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.orElseThrow(() -> {
|
||||||
|
log.error("BPM状态码为null");
|
||||||
|
return new IllegalArgumentException("BPM状态码不能为null");
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.alibaba.fastjson2.JSONException;
|
|||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
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.framework.security.core.util.SecurityFrameworkUtils;
|
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
@@ -17,6 +18,7 @@ import com.zt.plat.module.contractorder.api.vo.contract.ContractRespVO;
|
|||||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*;
|
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.*;
|
||||||
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.*;
|
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.*;
|
||||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.SystemRelativityDO;
|
import com.zt.plat.module.contractorder.dal.dataobject.contract.SystemRelativityDO;
|
||||||
|
import com.zt.plat.module.contractorder.dal.dataobject.purchaseorder.PurchaseOrderDO;
|
||||||
import com.zt.plat.module.contractorder.dal.dataobject.salesorder.SalesOrderDO;
|
import com.zt.plat.module.contractorder.dal.dataobject.salesorder.SalesOrderDO;
|
||||||
import com.zt.plat.module.contractorder.dal.mysql.contract.SystemRelativityMapper;
|
import com.zt.plat.module.contractorder.dal.mysql.contract.SystemRelativityMapper;
|
||||||
import com.zt.plat.module.contractorder.dal.mysql.salesorder.SalesOrderMapper;
|
import com.zt.plat.module.contractorder.dal.mysql.salesorder.SalesOrderMapper;
|
||||||
@@ -40,6 +42,8 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static com.zt.plat.module.contractorder.enums.ErrorCodeConstants.CONTRACT_ORDER_EXISTS;
|
import static com.zt.plat.module.contractorder.enums.ErrorCodeConstants.CONTRACT_ORDER_EXISTS;
|
||||||
@@ -90,6 +94,11 @@ public class SalesOrderServiceImpl implements SalesOrderService {
|
|||||||
SalesOrderDO salesOrderDO = BeanUtils.toBean(createReqVO, SalesOrderDO.class);
|
SalesOrderDO salesOrderDO = BeanUtils.toBean(createReqVO, SalesOrderDO.class);
|
||||||
//订单号
|
//订单号
|
||||||
//生成订单号
|
//生成订单号
|
||||||
|
if (Objects.equals(createReqVO.getIsPush(), 0)) {
|
||||||
|
createReqVO.setStatus(OrderStatusEnum.DRAFT.getCode()); //设置初始状态
|
||||||
|
} else {
|
||||||
|
createReqVO.setStatus(OrderStatusEnum.TO_SUBMIT_ERP.getCode());
|
||||||
|
}
|
||||||
String orderNumber = generateOrderNumber(salesOrderDO.getMtrlTp());
|
String orderNumber = generateOrderNumber(salesOrderDO.getMtrlTp());
|
||||||
salesOrderDO.setSystemOrderNumber(orderNumber);
|
salesOrderDO.setSystemOrderNumber(orderNumber);
|
||||||
salesOrderDO.setStatus(OrderStatusEnum.DRAFT.getCode());
|
salesOrderDO.setStatus(OrderStatusEnum.DRAFT.getCode());
|
||||||
@@ -256,11 +265,14 @@ public class SalesOrderServiceImpl implements SalesOrderService {
|
|||||||
if (ObjectUtils.isEmpty(salesOrderDO)) {
|
if (ObjectUtils.isEmpty(salesOrderDO)) {
|
||||||
throw exception(ORDER_ID_NOT_EXISTS);
|
throw exception(ORDER_ID_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
|
if (salesOrderDO.getIsPush()==0) {
|
||||||
|
throw exception(ORDER_DONT_SUBMIT);
|
||||||
|
}
|
||||||
AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(SecurityFrameworkUtils.getLoginUserId()).getData();
|
AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(SecurityFrameworkUtils.getLoginUserId()).getData();
|
||||||
if (ObjectUtils.isEmpty(salesOrderDO.getProcessInstanceId())) {
|
if (ObjectUtils.isEmpty(salesOrderDO.getProcessInstanceId())) {
|
||||||
BpmProcessInstanceCreateReqDTO pidto = new BpmProcessInstanceCreateReqDTO();
|
BpmProcessInstanceCreateReqDTO pidto = new BpmProcessInstanceCreateReqDTO();
|
||||||
pidto.setProcessDefinitionKey(ProcessDefinitionKeyConstants.SALES_ORDER_REVIEW_PROCESS);
|
pidto.setProcessDefinitionKey(ProcessDefinitionKeyConstants.SALES_ORDER_REVIEW_PROCESS);
|
||||||
pidto.setBusinessKey(String.valueOf(id));
|
pidto.setBusinessKey(id);
|
||||||
String data = bpmProcessInstanceApi.createProcessInstance(adminUserRespDTO.getId(), pidto).getData();
|
String data = bpmProcessInstanceApi.createProcessInstance(adminUserRespDTO.getId(), pidto).getData();
|
||||||
if (StringUtils.isNotBlank(data)) {
|
if (StringUtils.isNotBlank(data)) {
|
||||||
// 获取流程当前审批的任务节点
|
// 获取流程当前审批的任务节点
|
||||||
@@ -311,55 +323,113 @@ public class SalesOrderServiceImpl implements SalesOrderService {
|
|||||||
return "提交审批成功";
|
return "提交审批成功";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// @Transactional
|
||||||
|
// public boolean orderPassReject(SalesOrderReviewReqVO salesOrderReviewReqVO) {
|
||||||
|
// SalesOrderDO salesOrderDO = salesOrderMapper.selectById(salesOrderReviewReqVO.getId());
|
||||||
|
// if (ObjectUtils.isEmpty(salesOrderDO)) {
|
||||||
|
// throw exception(PURCHASE_ORDER_NOT_EXISTS);
|
||||||
|
// }
|
||||||
|
// // 获取当前流程正在审批的任务节点
|
||||||
|
// List<BpmTaskRespDTO> taskList = bpmTaskApi.getTaskListByProcessInstanceId(salesOrderDO.getProcessInstanceId()).getData();
|
||||||
|
// BpmTaskRespDTO undoTask = taskList.get(taskList.size() - 1);
|
||||||
|
//
|
||||||
|
// // 判断是否流程已经通过、驳回
|
||||||
|
// BpmApprovalDetailReqDTO badrDto = new BpmApprovalDetailReqDTO();
|
||||||
|
// badrDto.setProcessInstanceId(salesOrderDO.getProcessInstanceId()); // 流程实例id
|
||||||
|
// badrDto.setTaskId(undoTask.getId()); // 当前审核任务节点id
|
||||||
|
// BpmApprovalDetailRespDTO approvalDetail = bpmProcessInstanceApi.getApprovalDetail(SecurityFrameworkUtils.getLoginUserId(), badrDto).getData();
|
||||||
|
// //如果审核通过
|
||||||
|
// if ("WAIT_PUSH".equals(salesOrderReviewReqVO.getStatus())) {
|
||||||
|
// salesOrderDO.setStatus(getStatusByBpmProcessInstanceCode(approvalDetail.getStatus()));
|
||||||
|
// } else {
|
||||||
|
// //如果审核不通过
|
||||||
|
// salesOrderDO.setStatus(OrderStatusEnum.DRAFT.getCode());
|
||||||
|
// }
|
||||||
|
// //设置审核意见
|
||||||
|
// salesOrderDO.setReviewOpinion(salesOrderDO.getReviewOpinion());
|
||||||
|
// if (ObjectUtils.isNotEmpty(undoTask)) {
|
||||||
|
// salesOrderDO.setTaskId(undoTask.getId());
|
||||||
|
// }
|
||||||
|
// salesOrderMapper.updateById(salesOrderDO); //更新状态
|
||||||
|
//
|
||||||
|
// // 需要调用bpm 审核接口更新审批中的状态
|
||||||
|
// if (DictEnum.BSE_CTRT_STS_WAIT_PUSH.getCode().equals(salesOrderDO.getStatus()) && ObjectUtils.isNotEmpty(undoTask)) {
|
||||||
|
// if (approvalDetail.getStatus().equals(BpmProcessInstanceStatusEnum.RUNNING.getStatus())) {
|
||||||
|
// BpmTaskApproveReqDTO btarDto = new BpmTaskApproveReqDTO();
|
||||||
|
// btarDto.setId(undoTask.getId());
|
||||||
|
// btarDto.setReason(salesOrderDO.getReviewOpinion());
|
||||||
|
// bpmProcessInstanceApi.approveTask(btarDto);
|
||||||
|
// }
|
||||||
|
// } else if (DictEnum.BSE_CTRT_STS_REJECTED.getCode().equals(salesOrderDO.getStatus()) && ObjectUtils.isNotEmpty(undoTask)) {
|
||||||
|
// if (approvalDetail.getStatus().equals(BpmProcessInstanceStatusEnum.RUNNING.getStatus())) {
|
||||||
|
// BpmTaskRejectReqDTO btrrDto = new BpmTaskRejectReqDTO();
|
||||||
|
// btrrDto.setId(undoTask.getId());
|
||||||
|
// btrrDto.setReason(salesOrderDO.getReviewOpinion());
|
||||||
|
// bpmProcessInstanceApi.rejectTask(btrrDto);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional(rollbackFor=Exception.class)
|
||||||
public boolean orderPassReject(SalesOrderReviewReqVO salesOrderReviewReqVO) {
|
public boolean orderPassReject(SalesOrderReviewReqVO salesOrderReviewReqVO) {
|
||||||
|
// 查询采购单
|
||||||
SalesOrderDO salesOrderDO = salesOrderMapper.selectById(salesOrderReviewReqVO.getId());
|
SalesOrderDO salesOrderDO = salesOrderMapper.selectById(salesOrderReviewReqVO.getId());
|
||||||
if (ObjectUtils.isEmpty(salesOrderDO)) {
|
if (ObjectUtils.isEmpty(salesOrderDO)) {
|
||||||
throw exception(PURCHASE_ORDER_NOT_EXISTS);
|
throw exception(PURCHASE_ORDER_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
// 获取当前流程正在审批的任务节点
|
|
||||||
|
// 获取当前流程的所有任务节点
|
||||||
List<BpmTaskRespDTO> taskList = bpmTaskApi.getTaskListByProcessInstanceId(salesOrderDO.getProcessInstanceId()).getData();
|
List<BpmTaskRespDTO> taskList = bpmTaskApi.getTaskListByProcessInstanceId(salesOrderDO.getProcessInstanceId()).getData();
|
||||||
BpmTaskRespDTO undoTask = taskList.get(taskList.size() - 1);
|
|
||||||
|
|
||||||
// 判断是否流程已经通过、驳回
|
// 筛选出当前待处理的任务(未结束的任务)
|
||||||
|
BpmTaskRespDTO undoTask = taskList.stream()
|
||||||
|
.filter(task -> task.getEndTime() == null)
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
|
||||||
|
if (ObjectUtils.isEmpty(undoTask)) {
|
||||||
|
throw new RuntimeException("未找到待审批的任务节点");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 先调用BPM审批接口,再更新本地状态
|
||||||
|
if (DictEnum.BSE_CTRT_STS_WAIT_PUSH.getCode().equals(salesOrderReviewReqVO.getStatus())) {
|
||||||
|
// 审批通过
|
||||||
|
BpmTaskApproveReqDTO btarDto = new BpmTaskApproveReqDTO();
|
||||||
|
btarDto.setId(undoTask.getId());
|
||||||
|
btarDto.setReason(salesOrderReviewReqVO.getReviewOpinion());
|
||||||
|
CommonResult<Boolean> result = bpmProcessInstanceApi.approveTask(btarDto);
|
||||||
|
if (result.isError()) {
|
||||||
|
throw new RuntimeException(result.getMsg());
|
||||||
|
}
|
||||||
|
} else if (DictEnum.BSE_CTRT_STS_REJECTED.getCode().equals(salesOrderReviewReqVO.getStatus())) {
|
||||||
|
// 审批驳回
|
||||||
|
BpmTaskRejectReqDTO btrrDto = new BpmTaskRejectReqDTO();
|
||||||
|
btrrDto.setId(undoTask.getId());
|
||||||
|
btrrDto.setReason(salesOrderReviewReqVO.getReviewOpinion());
|
||||||
|
CommonResult<Boolean> result = bpmProcessInstanceApi.rejectTask(btrrDto);
|
||||||
|
if (result.isError()) {
|
||||||
|
throw new RuntimeException(result.getMsg());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用BPM接口后,查询最新的审批详情
|
||||||
BpmApprovalDetailReqDTO badrDto = new BpmApprovalDetailReqDTO();
|
BpmApprovalDetailReqDTO badrDto = new BpmApprovalDetailReqDTO();
|
||||||
badrDto.setProcessInstanceId(salesOrderDO.getProcessInstanceId()); // 流程实例id
|
badrDto.setProcessInstanceId(salesOrderDO.getProcessInstanceId());
|
||||||
badrDto.setTaskId(undoTask.getId()); // 当前审核任务节点id
|
badrDto.setTaskId(undoTask.getId());
|
||||||
BpmApprovalDetailRespDTO approvalDetail = bpmProcessInstanceApi.getApprovalDetail(SecurityFrameworkUtils.getLoginUserId(), badrDto).getData();
|
BpmApprovalDetailRespDTO approvalDetail = bpmProcessInstanceApi.getApprovalDetail(SecurityFrameworkUtils.getLoginUserId(), badrDto).getData();
|
||||||
//如果审核通过
|
|
||||||
if ("WAIT_PUSH".equals(salesOrderReviewReqVO.getStatus())) {
|
|
||||||
salesOrderDO.setStatus(OrderStatusEnum.TO_SUBMIT_ERP.getCode());
|
|
||||||
} else {
|
|
||||||
//如果审核不通过
|
|
||||||
salesOrderDO.setStatus(OrderStatusEnum.DRAFT.getCode());
|
|
||||||
}
|
|
||||||
//设置审核意见
|
|
||||||
salesOrderDO.setReviewOpinion(salesOrderDO.getReviewOpinion());
|
|
||||||
if (ObjectUtils.isNotEmpty(undoTask)) {
|
|
||||||
salesOrderDO.setTaskId(undoTask.getId());
|
|
||||||
}
|
|
||||||
salesOrderMapper.updateById(salesOrderDO); //更新状态
|
|
||||||
|
|
||||||
// 需要调用bpm 审核接口更新审批中的状态
|
// 使用统一方法转换状态
|
||||||
if (DictEnum.BSE_CTRT_STS_WAIT_PUSH.getCode().equals(salesOrderDO.getStatus()) && ObjectUtils.isNotEmpty(undoTask)) {
|
salesOrderDO.setStatus(getStatusByBpmProcessInstanceCode(approvalDetail.getStatus()));
|
||||||
if (approvalDetail.getStatus().equals(BpmProcessInstanceStatusEnum.RUNNING.getStatus())) {
|
salesOrderDO.setReviewOpinion(salesOrderReviewReqVO.getReviewOpinion());
|
||||||
BpmTaskApproveReqDTO btarDto = new BpmTaskApproveReqDTO();
|
salesOrderDO.setTaskId(undoTask.getId());
|
||||||
btarDto.setId(undoTask.getId());
|
|
||||||
btarDto.setReason(salesOrderDO.getReviewOpinion());
|
salesOrderMapper.updateById(salesOrderDO);
|
||||||
bpmProcessInstanceApi.approveTask(btarDto);
|
|
||||||
}
|
|
||||||
} else if (DictEnum.BSE_CTRT_STS_REJECTED.getCode().equals(salesOrderDO.getStatus()) && ObjectUtils.isNotEmpty(undoTask)) {
|
|
||||||
if (approvalDetail.getStatus().equals(BpmProcessInstanceStatusEnum.RUNNING.getStatus())) {
|
|
||||||
BpmTaskRejectReqDTO btrrDto = new BpmTaskRejectReqDTO();
|
|
||||||
btrrDto.setId(undoTask.getId());
|
|
||||||
btrrDto.setReason(salesOrderDO.getReviewOpinion());
|
|
||||||
bpmProcessInstanceApi.rejectTask(btrrDto);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean linkOrder(LinkOrderReqVO LinkOrderReqVO) {
|
public boolean linkOrder(LinkOrderReqVO LinkOrderReqVO) {
|
||||||
|
|
||||||
@@ -460,4 +530,15 @@ public class SalesOrderServiceImpl implements SalesOrderService {
|
|||||||
throw exception(PURCHASE_ORDER_NOT_EXISTS);
|
throw exception(PURCHASE_ORDER_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getStatusByBpmProcessInstanceCode(Integer code) {
|
||||||
|
return Optional.ofNullable(code)
|
||||||
|
.map(c -> switch (c) {
|
||||||
|
case -1, 3, 4 -> OrderStatusEnum.DRAFT.getCode();
|
||||||
|
case 1 -> OrderStatusEnum.APPROVING.getCode();
|
||||||
|
case 2 -> OrderStatusEnum.TO_SUBMIT_ERP.getCode();
|
||||||
|
default -> throw new IllegalArgumentException("未定义的BPM状态码:" + c);
|
||||||
|
})
|
||||||
|
.orElseThrow(() -> new IllegalArgumentException("BPM状态码不能为null"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public interface ErpExternalApi {
|
|||||||
@Operation(summary = "erp数据提交")
|
@Operation(summary = "erp数据提交")
|
||||||
HashMap<String, String> submitDataToErp(@Valid @RequestBody ErpSubmitReqDTO reqDTO);
|
HashMap<String, String> submitDataToErp(@Valid @RequestBody ErpSubmitReqDTO reqDTO);
|
||||||
|
|
||||||
@GetMapping(PREFIX + "/query")
|
@PostMapping(PREFIX + "/query")
|
||||||
@Operation(summary = "erp数据查询")
|
@Operation(summary = "erp数据查询")
|
||||||
HashMap<String, Object> queryDataToErp(@Valid @RequestBody ErpQueryReqDTO reqDTO);
|
HashMap<String, Object> queryDataToErp(@Valid @RequestBody ErpQueryReqDTO reqDTO);
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public class ErpExternalApiImpl implements ErpExternalApi {
|
|||||||
@Override
|
@Override
|
||||||
public HashMap<String, Object> queryDataToErp(ErpQueryReqDTO reqDTO) {
|
public HashMap<String, Object> queryDataToErp(ErpQueryReqDTO reqDTO) {
|
||||||
String funcnr = reqDTO.getFuncnr();
|
String funcnr = reqDTO.getFuncnr();
|
||||||
Map<String, Object> req = new HashMap<>();
|
Map<String, Object> req = reqDTO.getReq();
|
||||||
return erpConfig.fetchDataFromERP(funcnr, req);
|
return erpConfig.fetchDataFromERP(funcnr, req);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,17 +17,17 @@ public interface ErpAssetMapper extends BaseMapperX<ErpAssetDO> {
|
|||||||
|
|
||||||
default PageResult<ErpAssetDO> selectPage(ErpAssetPageReqVO reqVO) {
|
default PageResult<ErpAssetDO> selectPage(ErpAssetPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpAssetDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpAssetDO>()
|
||||||
.eqIfPresent(ErpAssetDO::getCompanyNumber, reqVO.getCompanyNumber())
|
.likeIfPresent(ErpAssetDO::getCompanyNumber, reqVO.getCompanyNumber())
|
||||||
.eqIfPresent(ErpAssetDO::getMainAssetNumber, reqVO.getMainAssetNumber())
|
.likeIfPresent(ErpAssetDO::getMainAssetNumber, reqVO.getMainAssetNumber())
|
||||||
.betweenIfPresent(ErpAssetDO::getRecordCreateDate, reqVO.getRecordCreateDate())
|
.betweenIfPresent(ErpAssetDO::getRecordCreateDate, reqVO.getRecordCreateDate())
|
||||||
.likeIfPresent(ErpAssetDO::getUpdateUserName, reqVO.getUpdateUserName())
|
.likeIfPresent(ErpAssetDO::getUpdateUserName, reqVO.getUpdateUserName())
|
||||||
.eqIfPresent(ErpAssetDO::getAssetTypeNumber, reqVO.getAssetTypeNumber())
|
.likeIfPresent(ErpAssetDO::getAssetTypeNumber, reqVO.getAssetTypeNumber())
|
||||||
.likeIfPresent(ErpAssetDO::getAssetTypeName, reqVO.getAssetTypeName())
|
.likeIfPresent(ErpAssetDO::getAssetTypeName, reqVO.getAssetTypeName())
|
||||||
.betweenIfPresent(ErpAssetDO::getAssetDate, reqVO.getAssetDate())
|
.betweenIfPresent(ErpAssetDO::getAssetDate, reqVO.getAssetDate())
|
||||||
.eqIfPresent(ErpAssetDO::getUom, reqVO.getUom())
|
.eqIfPresent(ErpAssetDO::getUom, reqVO.getUom())
|
||||||
.eqIfPresent(ErpAssetDO::getQuantity, reqVO.getQuantity())
|
.eqIfPresent(ErpAssetDO::getQuantity, reqVO.getQuantity())
|
||||||
.eqIfPresent(ErpAssetDO::getAssetDescription, reqVO.getAssetDescription())
|
.likeIfPresent(ErpAssetDO::getAssetDescription, reqVO.getAssetDescription())
|
||||||
.eqIfPresent(ErpAssetDO::getAssetDescriptionAttach, reqVO.getAssetDescriptionAttach())
|
.likeIfPresent(ErpAssetDO::getAssetDescriptionAttach, reqVO.getAssetDescriptionAttach())
|
||||||
.betweenIfPresent(ErpAssetDO::getDepreciationStartDate, reqVO.getDepreciationStartDate())
|
.betweenIfPresent(ErpAssetDO::getDepreciationStartDate, reqVO.getDepreciationStartDate())
|
||||||
.eqIfPresent(ErpAssetDO::getPlanYearDate, reqVO.getPlanYearDate())
|
.eqIfPresent(ErpAssetDO::getPlanYearDate, reqVO.getPlanYearDate())
|
||||||
.eqIfPresent(ErpAssetDO::getCostcenterNumber, reqVO.getCostcenterNumber())
|
.eqIfPresent(ErpAssetDO::getCostcenterNumber, reqVO.getCostcenterNumber())
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ public interface ErpBomMapper extends BaseMapperX<ErpBomDO> {
|
|||||||
|
|
||||||
default PageResult<ErpBomDO> selectPage(ErpBomPageReqVO reqVO) {
|
default PageResult<ErpBomDO> selectPage(ErpBomPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpBomDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpBomDO>()
|
||||||
.eqIfPresent(ErpBomDO::getFactoryNumber, reqVO.getFactoryNumber())
|
.likeIfPresent(ErpBomDO::getFactoryNumber, reqVO.getFactoryNumber())
|
||||||
.eqIfPresent(ErpBomDO::getUpMaterial, reqVO.getUpMaterial())
|
.likeIfPresent(ErpBomDO::getUpMaterial, reqVO.getUpMaterial())
|
||||||
.eqIfPresent(ErpBomDO::getUseItem, reqVO.getUseItem())
|
.eqIfPresent(ErpBomDO::getUseItem, reqVO.getUseItem())
|
||||||
.eqIfPresent(ErpBomDO::getMaterialDescription, reqVO.getMaterialDescription())
|
.likeIfPresent(ErpBomDO::getMaterialDescription, reqVO.getMaterialDescription())
|
||||||
.eqIfPresent(ErpBomDO::getQuantity, reqVO.getQuantity())
|
.eqIfPresent(ErpBomDO::getQuantity, reqVO.getQuantity())
|
||||||
.eqIfPresent(ErpBomDO::getUnit, reqVO.getUnit())
|
.eqIfPresent(ErpBomDO::getUnit, reqVO.getUnit())
|
||||||
.orderByDesc(ErpBomDO::getId));
|
.orderByDesc(ErpBomDO::getId));
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ public interface ErpCompanyMapper extends BaseMapperX<ErpCompanyDO> {
|
|||||||
default PageResult<ErpCompanyDO> selectPage(ErpCompanyPageReqVO reqVO) {
|
default PageResult<ErpCompanyDO> selectPage(ErpCompanyPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpCompanyDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpCompanyDO>()
|
||||||
.likeIfPresent(ErpCompanyDO::getName, reqVO.getName())
|
.likeIfPresent(ErpCompanyDO::getName, reqVO.getName())
|
||||||
.eqIfPresent(ErpCompanyDO::getNumber, reqVO.getNumber())
|
.likeIfPresent(ErpCompanyDO::getNumber, reqVO.getNumber())
|
||||||
.eqIfPresent(ErpCompanyDO::getCurrency, reqVO.getCurrency())
|
.eqIfPresent(ErpCompanyDO::getCurrency, reqVO.getCurrency())
|
||||||
.orderByDesc(ErpCompanyDO::getId));
|
.orderByDesc(ErpCompanyDO::getId));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,17 +19,17 @@ public interface ErpContractMapper extends BaseMapperX<ErpContractDO> {
|
|||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpContractDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpContractDO>()
|
||||||
.eqIfPresent(ErpContractDO::getOperationId, reqVO.getOperationId())
|
.eqIfPresent(ErpContractDO::getOperationId, reqVO.getOperationId())
|
||||||
.eqIfPresent(ErpContractDO::getContractMainId, reqVO.getContractMainId())
|
.eqIfPresent(ErpContractDO::getContractMainId, reqVO.getContractMainId())
|
||||||
.eqIfPresent(ErpContractDO::getContractPaperNumber, reqVO.getContractPaperNumber())
|
.likeIfPresent(ErpContractDO::getContractPaperNumber, reqVO.getContractPaperNumber())
|
||||||
.likeIfPresent(ErpContractDO::getContractName, reqVO.getContractName())
|
.likeIfPresent(ErpContractDO::getContractName, reqVO.getContractName())
|
||||||
.eqIfPresent(ErpContractDO::getContractTypeNumber, reqVO.getContractTypeNumber())
|
.likeIfPresent(ErpContractDO::getContractTypeNumber, reqVO.getContractTypeNumber())
|
||||||
.likeIfPresent(ErpContractDO::getContractTypeName, reqVO.getContractTypeName())
|
.likeIfPresent(ErpContractDO::getContractTypeName, reqVO.getContractTypeName())
|
||||||
.eqIfPresent(ErpContractDO::getContractCategory, reqVO.getContractCategory())
|
.eqIfPresent(ErpContractDO::getContractCategory, reqVO.getContractCategory())
|
||||||
.eqIfPresent(ErpContractDO::getIsVirtualContract, reqVO.getIsVirtualContract())
|
.eqIfPresent(ErpContractDO::getIsVirtualContract, reqVO.getIsVirtualContract())
|
||||||
.eqIfPresent(ErpContractDO::getSupplierNumber, reqVO.getSupplierNumber())
|
.likeIfPresent(ErpContractDO::getSupplierNumber, reqVO.getSupplierNumber())
|
||||||
.likeIfPresent(ErpContractDO::getSupplierName, reqVO.getSupplierName())
|
.likeIfPresent(ErpContractDO::getSupplierName, reqVO.getSupplierName())
|
||||||
.eqIfPresent(ErpContractDO::getAgent, reqVO.getAgent())
|
.eqIfPresent(ErpContractDO::getAgent, reqVO.getAgent())
|
||||||
.eqIfPresent(ErpContractDO::getContractImplementNumber, reqVO.getContractImplementNumber())
|
.likeIfPresent(ErpContractDO::getContractImplementNumber, reqVO.getContractImplementNumber())
|
||||||
.eqIfPresent(ErpContractDO::getContractSignNumber, reqVO.getContractSignNumber())
|
.likeIfPresent(ErpContractDO::getContractSignNumber, reqVO.getContractSignNumber())
|
||||||
.betweenIfPresent(ErpContractDO::getSignDate, reqVO.getSignDate())
|
.betweenIfPresent(ErpContractDO::getSignDate, reqVO.getSignDate())
|
||||||
.betweenIfPresent(ErpContractDO::getStartDate, reqVO.getStartDate())
|
.betweenIfPresent(ErpContractDO::getStartDate, reqVO.getStartDate())
|
||||||
.betweenIfPresent(ErpContractDO::getStopDate, reqVO.getStopDate())
|
.betweenIfPresent(ErpContractDO::getStopDate, reqVO.getStopDate())
|
||||||
@@ -52,7 +52,7 @@ public interface ErpContractMapper extends BaseMapperX<ErpContractDO> {
|
|||||||
.eqIfPresent(ErpContractDO::getQualityassuranceAmount, reqVO.getQualityassuranceAmount())
|
.eqIfPresent(ErpContractDO::getQualityassuranceAmount, reqVO.getQualityassuranceAmount())
|
||||||
.eqIfPresent(ErpContractDO::getIsInternal, reqVO.getIsInternal())
|
.eqIfPresent(ErpContractDO::getIsInternal, reqVO.getIsInternal())
|
||||||
.eqIfPresent(ErpContractDO::getNature, reqVO.getNature())
|
.eqIfPresent(ErpContractDO::getNature, reqVO.getNature())
|
||||||
.eqIfPresent(ErpContractDO::getRemark, reqVO.getRemark())
|
.likeIfPresent(ErpContractDO::getRemark, reqVO.getRemark())
|
||||||
.eqIfPresent(ErpContractDO::getSourceAccumulateSettlementAmount, reqVO.getSourceAccumulateSettlementAmount())
|
.eqIfPresent(ErpContractDO::getSourceAccumulateSettlementAmount, reqVO.getSourceAccumulateSettlementAmount())
|
||||||
.eqIfPresent(ErpContractDO::getBasicAccumulateSettlementAmount, reqVO.getBasicAccumulateSettlementAmount())
|
.eqIfPresent(ErpContractDO::getBasicAccumulateSettlementAmount, reqVO.getBasicAccumulateSettlementAmount())
|
||||||
.eqIfPresent(ErpContractDO::getSourceUseAmount, reqVO.getSourceUseAmount())
|
.eqIfPresent(ErpContractDO::getSourceUseAmount, reqVO.getSourceUseAmount())
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public interface ErpCostcenterMapper extends BaseMapperX<ErpCostcenterDO> {
|
|||||||
|
|
||||||
default PageResult<ErpCostcenterDO> selectPage(ErpCostcenterPageReqVO reqVO) {
|
default PageResult<ErpCostcenterDO> selectPage(ErpCostcenterPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpCostcenterDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpCostcenterDO>()
|
||||||
.eqIfPresent(ErpCostcenterDO::getNumber, reqVO.getNumber())
|
.likeIfPresent(ErpCostcenterDO::getNumber, reqVO.getNumber())
|
||||||
.likeIfPresent(ErpCostcenterDO::getName, reqVO.getName())
|
.likeIfPresent(ErpCostcenterDO::getName, reqVO.getName())
|
||||||
.eqIfPresent(ErpCostcenterDO::getIsUse, reqVO.getIsUse())
|
.eqIfPresent(ErpCostcenterDO::getIsUse, reqVO.getIsUse())
|
||||||
.eqIfPresent(ErpCostcenterDO::getScopeNumber, reqVO.getScopeNumber())
|
.eqIfPresent(ErpCostcenterDO::getScopeNumber, reqVO.getScopeNumber())
|
||||||
|
|||||||
@@ -17,10 +17,10 @@ public interface ErpCustomerMapper extends BaseMapperX<ErpCustomerDO> {
|
|||||||
|
|
||||||
default PageResult<ErpCustomerDO> selectPage(ErpCustomerPageReqVO reqVO) {
|
default PageResult<ErpCustomerDO> selectPage(ErpCustomerPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpCustomerDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpCustomerDO>()
|
||||||
.eqIfPresent(ErpCustomerDO::getNumber, reqVO.getNumber())
|
.likeIfPresent(ErpCustomerDO::getNumber, reqVO.getNumber())
|
||||||
.likeIfPresent(ErpCustomerDO::getName, reqVO.getName())
|
.likeIfPresent(ErpCustomerDO::getName, reqVO.getName())
|
||||||
.eqIfPresent(ErpCustomerDO::getAccountGroup, reqVO.getAccountGroup())
|
.eqIfPresent(ErpCustomerDO::getAccountGroup, reqVO.getAccountGroup())
|
||||||
.eqIfPresent(ErpCustomerDO::getDescription, reqVO.getDescription())
|
.likeIfPresent(ErpCustomerDO::getDescription, reqVO.getDescription())
|
||||||
.eqIfPresent(ErpCustomerDO::getCenterNumber, reqVO.getCenterNumber())
|
.eqIfPresent(ErpCustomerDO::getCenterNumber, reqVO.getCenterNumber())
|
||||||
.betweenIfPresent(ErpCustomerDO::getCreateDate, reqVO.getCreateDate())
|
.betweenIfPresent(ErpCustomerDO::getCreateDate, reqVO.getCreateDate())
|
||||||
.betweenIfPresent(ErpCustomerDO::getRepairDate, reqVO.getRepairDate())
|
.betweenIfPresent(ErpCustomerDO::getRepairDate, reqVO.getRepairDate())
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ public interface ErpInternalOrderMapper extends BaseMapperX<ErpInternalOrderDO>
|
|||||||
|
|
||||||
default PageResult<ErpInternalOrderDO> selectPage(ErpInternalOrderPageReqVO reqVO) {
|
default PageResult<ErpInternalOrderDO> selectPage(ErpInternalOrderPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpInternalOrderDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpInternalOrderDO>()
|
||||||
.eqIfPresent(ErpInternalOrderDO::getNumber, reqVO.getNumber())
|
.likeIfPresent(ErpInternalOrderDO::getNumber, reqVO.getNumber())
|
||||||
.likeIfPresent(ErpInternalOrderDO::getName, reqVO.getName())
|
.likeIfPresent(ErpInternalOrderDO::getName, reqVO.getName())
|
||||||
.eqIfPresent(ErpInternalOrderDO::getType, reqVO.getType())
|
.eqIfPresent(ErpInternalOrderDO::getType, reqVO.getType())
|
||||||
.eqIfPresent(ErpInternalOrderDO::getIsOff, reqVO.getIsOff())
|
.eqIfPresent(ErpInternalOrderDO::getIsOff, reqVO.getIsOff())
|
||||||
|
|||||||
@@ -27,12 +27,12 @@ public interface ErpMaterialMapper extends BaseMapperX<ErpMaterialDO> {
|
|||||||
.betweenIfPresent(ErpMaterialDO::getMaterialGroupDate, reqVO.getMaterialGroupDate())
|
.betweenIfPresent(ErpMaterialDO::getMaterialGroupDate, reqVO.getMaterialGroupDate())
|
||||||
.betweenIfPresent(ErpMaterialDO::getExternalMaterialGroupDate, reqVO.getExternalMaterialGroupDate())
|
.betweenIfPresent(ErpMaterialDO::getExternalMaterialGroupDate, reqVO.getExternalMaterialGroupDate())
|
||||||
.eqIfPresent(ErpMaterialDO::getUnit, reqVO.getUnit())
|
.eqIfPresent(ErpMaterialDO::getUnit, reqVO.getUnit())
|
||||||
.eqIfPresent(ErpMaterialDO::getUnitDescription, reqVO.getUnitDescription())
|
.likeIfPresent(ErpMaterialDO::getUnitDescription, reqVO.getUnitDescription())
|
||||||
.eqIfPresent(ErpMaterialDO::getMaterialTypeDescription, reqVO.getMaterialTypeDescription())
|
.likeIfPresent(ErpMaterialDO::getMaterialTypeDescription, reqVO.getMaterialTypeDescription())
|
||||||
.eqIfPresent(ErpMaterialDO::getMaterialGroupDescription, reqVO.getMaterialGroupDescription())
|
.likeIfPresent(ErpMaterialDO::getMaterialGroupDescription, reqVO.getMaterialGroupDescription())
|
||||||
.eqIfPresent(ErpMaterialDO::getExternalMaterialGroupDescription, reqVO.getExternalMaterialGroupDescription())
|
.eqIfPresent(ErpMaterialDO::getExternalMaterialGroupDescription, reqVO.getExternalMaterialGroupDescription())
|
||||||
.likeIfPresent(ErpMaterialDO::getMaterialName, reqVO.getMaterialName())
|
.likeIfPresent(ErpMaterialDO::getMaterialName, reqVO.getMaterialName())
|
||||||
.eqIfPresent(ErpMaterialDO::getMaterialLengthDescription, reqVO.getMaterialLengthDescription())
|
.likeIfPresent(ErpMaterialDO::getMaterialLengthDescription, reqVO.getMaterialLengthDescription())
|
||||||
.orderByDesc(ErpMaterialDO::getId));
|
.orderByDesc(ErpMaterialDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ public interface ErpProcessDetailMapper extends BaseMapperX<ErpProcessDetailDO>
|
|||||||
default PageResult<ErpProcessDetailDO> selectPage(ErpProcessDetailPageReqVO reqVO) {
|
default PageResult<ErpProcessDetailDO> selectPage(ErpProcessDetailPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpProcessDetailDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpProcessDetailDO>()
|
||||||
.eqIfPresent(ErpProcessDetailDO::getProcessId, reqVO.getProcessId())
|
.eqIfPresent(ErpProcessDetailDO::getProcessId, reqVO.getProcessId())
|
||||||
.eqIfPresent(ErpProcessDetailDO::getProcessingNumber, reqVO.getProcessingNumber())
|
.likeIfPresent(ErpProcessDetailDO::getProcessingNumber, reqVO.getProcessingNumber())
|
||||||
.likeIfPresent(ErpProcessDetailDO::getProcessingName, reqVO.getProcessingName())
|
.likeIfPresent(ErpProcessDetailDO::getProcessingName, reqVO.getProcessingName())
|
||||||
.eqIfPresent(ErpProcessDetailDO::getUom, reqVO.getUom())
|
.eqIfPresent(ErpProcessDetailDO::getUom, reqVO.getUom())
|
||||||
.eqIfPresent(ErpProcessDetailDO::getWorkCenterNumber, reqVO.getWorkCenterNumber())
|
.likeIfPresent(ErpProcessDetailDO::getWorkCenterNumber, reqVO.getWorkCenterNumber())
|
||||||
.likeIfPresent(ErpProcessDetailDO::getWorkCenterName, reqVO.getWorkCenterName())
|
.likeIfPresent(ErpProcessDetailDO::getWorkCenterName, reqVO.getWorkCenterName())
|
||||||
.orderByDesc(ErpProcessDetailDO::getId));
|
.orderByDesc(ErpProcessDetailDO::getId));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,12 +17,12 @@ public interface ErpProcessMapper extends BaseMapperX<ErpProcessDO> {
|
|||||||
|
|
||||||
default PageResult<ErpProcessDO> selectPage(ErpProcessPageReqVO reqVO) {
|
default PageResult<ErpProcessDO> selectPage(ErpProcessPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpProcessDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpProcessDO>()
|
||||||
.eqIfPresent(ErpProcessDO::getFactoryNumber, reqVO.getFactoryNumber())
|
.likeIfPresent(ErpProcessDO::getFactoryNumber, reqVO.getFactoryNumber())
|
||||||
.eqIfPresent(ErpProcessDO::getMaterialNumber, reqVO.getMaterialNumber())
|
.likeIfPresent(ErpProcessDO::getMaterialNumber, reqVO.getMaterialNumber())
|
||||||
.likeIfPresent(ErpProcessDO::getMaterialName, reqVO.getMaterialName())
|
.likeIfPresent(ErpProcessDO::getMaterialName, reqVO.getMaterialName())
|
||||||
.eqIfPresent(ErpProcessDO::getBlineGroup, reqVO.getBlineGroup())
|
.eqIfPresent(ErpProcessDO::getBlineGroup, reqVO.getBlineGroup())
|
||||||
.eqIfPresent(ErpProcessDO::getGroupCount, reqVO.getGroupCount())
|
.eqIfPresent(ErpProcessDO::getGroupCount, reqVO.getGroupCount())
|
||||||
.eqIfPresent(ErpProcessDO::getBlineDescription, reqVO.getBlineDescription())
|
.likeIfPresent(ErpProcessDO::getBlineDescription, reqVO.getBlineDescription())
|
||||||
.eqIfPresent(ErpProcessDO::getUom, reqVO.getUom())
|
.eqIfPresent(ErpProcessDO::getUom, reqVO.getUom())
|
||||||
.eqIfPresent(ErpProcessDO::getUseDescription, reqVO.getUseDescription())
|
.eqIfPresent(ErpProcessDO::getUseDescription, reqVO.getUseDescription())
|
||||||
.eqIfPresent(ErpProcessDO::getStatus, reqVO.getStatus())
|
.eqIfPresent(ErpProcessDO::getStatus, reqVO.getStatus())
|
||||||
|
|||||||
@@ -17,21 +17,21 @@ public interface ErpProductiveOrderMapper extends BaseMapperX<ErpProductiveOrder
|
|||||||
|
|
||||||
default PageResult<ErpProductiveOrderDO> selectPage(ErpProductiveOrderPageReqVO reqVO) {
|
default PageResult<ErpProductiveOrderDO> selectPage(ErpProductiveOrderPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpProductiveOrderDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpProductiveOrderDO>()
|
||||||
.eqIfPresent(ErpProductiveOrderDO::getCompanyNumber, reqVO.getCompanyNumber())
|
.likeIfPresent(ErpProductiveOrderDO::getCompanyNumber, reqVO.getCompanyNumber())
|
||||||
.eqIfPresent(ErpProductiveOrderDO::getFactoryNumber, reqVO.getFactoryNumber())
|
.likeIfPresent(ErpProductiveOrderDO::getFactoryNumber, reqVO.getFactoryNumber())
|
||||||
.likeIfPresent(ErpProductiveOrderDO::getFactoryName, reqVO.getFactoryName())
|
.likeIfPresent(ErpProductiveOrderDO::getFactoryName, reqVO.getFactoryName())
|
||||||
.eqIfPresent(ErpProductiveOrderDO::getOrderNumber, reqVO.getOrderNumber())
|
.likeIfPresent(ErpProductiveOrderDO::getOrderNumber, reqVO.getOrderNumber())
|
||||||
.betweenIfPresent(ErpProductiveOrderDO::getStartDate, reqVO.getStartDate())
|
.betweenIfPresent(ErpProductiveOrderDO::getStartDate, reqVO.getStartDate())
|
||||||
.betweenIfPresent(ErpProductiveOrderDO::getEndDate, reqVO.getEndDate())
|
.betweenIfPresent(ErpProductiveOrderDO::getEndDate, reqVO.getEndDate())
|
||||||
.eqIfPresent(ErpProductiveOrderDO::getMainMaterialNumber, reqVO.getMainMaterialNumber())
|
.likeIfPresent(ErpProductiveOrderDO::getMainMaterialNumber, reqVO.getMainMaterialNumber())
|
||||||
.eqIfPresent(ErpProductiveOrderDO::getUnit, reqVO.getUnit())
|
.eqIfPresent(ErpProductiveOrderDO::getUnit, reqVO.getUnit())
|
||||||
.eqIfPresent(ErpProductiveOrderDO::getMaterialDescription, reqVO.getMaterialDescription())
|
.likeIfPresent(ErpProductiveOrderDO::getMaterialDescription, reqVO.getMaterialDescription())
|
||||||
.eqIfPresent(ErpProductiveOrderDO::getProcessingList, reqVO.getProcessingList())
|
.eqIfPresent(ErpProductiveOrderDO::getProcessingList, reqVO.getProcessingList())
|
||||||
.eqIfPresent(ErpProductiveOrderDO::getProcessingNumber, reqVO.getProcessingNumber())
|
.eqIfPresent(ErpProductiveOrderDO::getProcessingNumber, reqVO.getProcessingNumber())
|
||||||
.eqIfPresent(ErpProductiveOrderDO::getProcessingDescription, reqVO.getProcessingDescription())
|
.likeIfPresent(ErpProductiveOrderDO::getProcessingDescription, reqVO.getProcessingDescription())
|
||||||
.eqIfPresent(ErpProductiveOrderDO::getObjectNumber, reqVO.getObjectNumber())
|
.eqIfPresent(ErpProductiveOrderDO::getObjectNumber, reqVO.getObjectNumber())
|
||||||
.eqIfPresent(ErpProductiveOrderDO::getWorkCenterNumber, reqVO.getWorkCenterNumber())
|
.eqIfPresent(ErpProductiveOrderDO::getWorkCenterNumber, reqVO.getWorkCenterNumber())
|
||||||
.eqIfPresent(ErpProductiveOrderDO::getWorkCenterDescription, reqVO.getWorkCenterDescription())
|
.likeIfPresent(ErpProductiveOrderDO::getWorkCenterDescription, reqVO.getWorkCenterDescription())
|
||||||
.eqIfPresent(ErpProductiveOrderDO::getCostcenterNumber, reqVO.getCostcenterNumber())
|
.eqIfPresent(ErpProductiveOrderDO::getCostcenterNumber, reqVO.getCostcenterNumber())
|
||||||
.likeIfPresent(ErpProductiveOrderDO::getCostcenterName, reqVO.getCostcenterName())
|
.likeIfPresent(ErpProductiveOrderDO::getCostcenterName, reqVO.getCostcenterName())
|
||||||
.orderByDesc(ErpProductiveOrderDO::getId));
|
.orderByDesc(ErpProductiveOrderDO::getId));
|
||||||
|
|||||||
@@ -19,11 +19,11 @@ public interface ErpProductiveVersionMapper extends BaseMapperX<ErpProductiveVer
|
|||||||
|
|
||||||
default PageResult<ErpProductiveVersionDO> selectPage(ErpProductiveVersionPageReqVO reqVO) {
|
default PageResult<ErpProductiveVersionDO> selectPage(ErpProductiveVersionPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpProductiveVersionDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpProductiveVersionDO>()
|
||||||
.eqIfPresent(ErpProductiveVersionDO::getFactoryNumber, reqVO.getFactoryNumber())
|
.likeIfPresent(ErpProductiveVersionDO::getFactoryNumber, reqVO.getFactoryNumber())
|
||||||
.eqIfPresent(ErpProductiveVersionDO::getMaterialNumber, reqVO.getMaterialNumber())
|
.likeIfPresent(ErpProductiveVersionDO::getMaterialNumber, reqVO.getMaterialNumber())
|
||||||
.eqIfPresent(ErpProductiveVersionDO::getProductiveVersionNumber, reqVO.getProductiveVersionNumber())
|
.likeIfPresent(ErpProductiveVersionDO::getProductiveVersionNumber, reqVO.getProductiveVersionNumber())
|
||||||
.likeIfPresent(ErpProductiveVersionDO::getProductiveVersionName, reqVO.getProductiveVersionName())
|
.likeIfPresent(ErpProductiveVersionDO::getProductiveVersionName, reqVO.getProductiveVersionName())
|
||||||
.eqIfPresent(ErpProductiveVersionDO::getBomNumber, reqVO.getBomNumber())
|
.likeIfPresent(ErpProductiveVersionDO::getBomNumber, reqVO.getBomNumber())
|
||||||
.eqIfPresent(ErpProductiveVersionDO::getBlineGroup, reqVO.getBlineGroup())
|
.eqIfPresent(ErpProductiveVersionDO::getBlineGroup, reqVO.getBlineGroup())
|
||||||
.eqIfPresent(ErpProductiveVersionDO::getGroupCount, reqVO.getGroupCount())
|
.eqIfPresent(ErpProductiveVersionDO::getGroupCount, reqVO.getGroupCount())
|
||||||
.orderByDesc(ErpProductiveVersionDO::getId));
|
.orderByDesc(ErpProductiveVersionDO::getId));
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ public interface ErpPurchaseOrganizationMapper extends BaseMapperX<ErpPurchaseOr
|
|||||||
|
|
||||||
default PageResult<ErpPurchaseOrganizationDO> selectPage(ErpPurchaseOrganizationPageReqVO reqVO) {
|
default PageResult<ErpPurchaseOrganizationDO> selectPage(ErpPurchaseOrganizationPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpPurchaseOrganizationDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpPurchaseOrganizationDO>()
|
||||||
.eqIfPresent(ErpPurchaseOrganizationDO::getNumber, reqVO.getNumber())
|
.likeIfPresent(ErpPurchaseOrganizationDO::getNumber, reqVO.getNumber())
|
||||||
.likeIfPresent(ErpPurchaseOrganizationDO::getName, reqVO.getName())
|
.likeIfPresent(ErpPurchaseOrganizationDO::getName, reqVO.getName())
|
||||||
.eqIfPresent(ErpPurchaseOrganizationDO::getCompanyNumber, reqVO.getCompanyNumber())
|
.likeIfPresent(ErpPurchaseOrganizationDO::getCompanyNumber, reqVO.getCompanyNumber())
|
||||||
.orderByDesc(ErpPurchaseOrganizationDO::getId));
|
.orderByDesc(ErpPurchaseOrganizationDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ public interface ErpSalesOrganizationMapper extends BaseMapperX<ErpSalesOrganiza
|
|||||||
|
|
||||||
default PageResult<ErpSalesOrganizationDO> selectPage(ErpSalesOrganizationPageReqVO reqVO) {
|
default PageResult<ErpSalesOrganizationDO> selectPage(ErpSalesOrganizationPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpSalesOrganizationDO>()
|
return selectPage(reqVO, new LambdaQueryWrapperX<ErpSalesOrganizationDO>()
|
||||||
.eqIfPresent(ErpSalesOrganizationDO::getNumber, reqVO.getNumber())
|
.likeIfPresent(ErpSalesOrganizationDO::getNumber, reqVO.getNumber())
|
||||||
.likeIfPresent(ErpSalesOrganizationDO::getName, reqVO.getName())
|
.likeIfPresent(ErpSalesOrganizationDO::getName, reqVO.getName())
|
||||||
.eqIfPresent(ErpSalesOrganizationDO::getCompanyNumber, reqVO.getCompanyNumber())
|
.likeIfPresent(ErpSalesOrganizationDO::getCompanyNumber, reqVO.getCompanyNumber())
|
||||||
.orderByDesc(ErpSalesOrganizationDO::getId));
|
.orderByDesc(ErpSalesOrganizationDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user