Merge remote-tracking branch 'origin/dev' into test
This commit is contained in:
@@ -42,7 +42,7 @@ public interface ContractApi {
|
||||
|
||||
@PostMapping(PREFIX + "/push")
|
||||
@Operation(summary = "国贸2.0系统推送合同")
|
||||
CommonResult<Boolean> push(@Valid @RequestBody IntContract reqVO) throws Exception;
|
||||
CommonResult<Boolean> push(@Valid @RequestBody IntContract reqVO);
|
||||
|
||||
@GetMapping(PREFIX + "/logistics/list/page")
|
||||
@Operation(summary = "国贸2.0系统合同分页查询")
|
||||
|
||||
@@ -8,6 +8,9 @@ import lombok.Getter;
|
||||
@Getter
|
||||
public enum DictEnum {
|
||||
|
||||
/** 方式系统 */
|
||||
BSE_SYS_REL_WY_EXTERNAL("系统外关联","EXTERNAL",null),
|
||||
BSE_SYS_REL_WY_INTERNAL("内关联","INTERNAL",null),
|
||||
/** 供应链业务大类 */
|
||||
SPLY_BSN_TP_03BX("货物保险","03BX",null),
|
||||
SPLY_BSN_TP_11CC("货物保管仓储","11CC",null),
|
||||
|
||||
@@ -11,7 +11,9 @@ import com.zt.plat.module.contractorder.api.dto.contract.ContractRespDTO;
|
||||
import com.zt.plat.module.contractorder.api.dto.order.PrchOrdDtlDTO;
|
||||
import com.zt.plat.module.contractorder.api.dto.order.PurchaseOrderWithDetailsDTO;
|
||||
import com.zt.plat.module.contractorder.api.dto.order.SalesOrdDtlDTO;
|
||||
import com.zt.plat.module.contractorder.api.vo.contract.international.*;
|
||||
import com.zt.plat.module.contractorder.api.vo.contract.international.IntContract;
|
||||
import com.zt.plat.module.contractorder.api.vo.contract.international.IntContractPageReq;
|
||||
import com.zt.plat.module.contractorder.api.vo.contract.international.Partner;
|
||||
import com.zt.plat.module.contractorder.controller.admin.purchaseorder.vo.PurchaseOrderDetailsRespVO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractMainDO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractOtherFieldDO;
|
||||
@@ -39,10 +41,12 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
@@ -151,10 +155,10 @@ public class ContractApiImpl implements ContractApi {
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public CommonResult<Boolean> push(@RequestBody IntContract reqVO) throws Exception {
|
||||
public CommonResult<Boolean> push(@RequestBody IntContract reqVO) {
|
||||
|
||||
// 合同主信息表映射
|
||||
ContractMainDO contractMainDO = getcontractMainDO(reqVO);
|
||||
ContractMainDO contractMainDO = internationalToMainDO(reqVO);
|
||||
|
||||
// 逻辑处理
|
||||
// 操作标志 I 新增/更新;D 删除
|
||||
@@ -178,7 +182,7 @@ public class ContractApiImpl implements ContractApi {
|
||||
SystemRelativityDO saveRelation = new SystemRelativityDO();
|
||||
saveRelation.setUpId(Long.parseLong(externalId));
|
||||
saveRelation.setDownId(contractId);
|
||||
saveRelation.setWay("EXTERNAL");
|
||||
saveRelation.setWay(DictEnum.BSE_SYS_REL_WY_EXTERNAL.getCode());
|
||||
saveRelation.setStatus(DictEnum.BSE_SYS_REL_TP_CONTRACT.getCode());
|
||||
systemRelativityMapper.insert(saveRelation);
|
||||
}
|
||||
@@ -242,107 +246,116 @@ public class ContractApiImpl implements ContractApi {
|
||||
contractOtherFieldMapper.delete("CTRT_MAIN_ID", contractId.toString());
|
||||
|
||||
// 请求参数保存到动态条款
|
||||
Field[] fields = reqVO.getClass().getDeclaredFields();
|
||||
saveFields(fields, contractId, null, reqVO);
|
||||
|
||||
// 明细部分保存
|
||||
// 附件清单列表
|
||||
ContractOtherFormDO otherFormDO = saveContractOtherForm(contractId, "attachList",
|
||||
"附件清单列表", "附件清单列表");
|
||||
List<ContractOtherFieldDO> otherFieldDOS = new ArrayList<>();
|
||||
if (reqVO.getAttachList() != null && !reqVO.getAttachList().isEmpty()) {
|
||||
for (String attach : reqVO.getAttachList()) {
|
||||
otherFieldDOS.add(getContractOtherField(contractId, otherFormDO.getId(), "attach", "附件",
|
||||
attach, "附件", "java.lang.String"));
|
||||
}
|
||||
}
|
||||
// 保存
|
||||
contractOtherFieldMapper.insertBatch(otherFieldDOS);
|
||||
|
||||
//----- 嵌套列表
|
||||
// 客商信息
|
||||
if (reqVO.getPartnerList() != null && !reqVO.getPartnerList().isEmpty()) {
|
||||
for (Partner partner : reqVO.getPartnerList()) {
|
||||
otherFormDO = saveContractOtherForm(contractId, "partnerList",
|
||||
"客商信息", "客商信息");
|
||||
fields = partner.getClass().getDeclaredFields();
|
||||
saveFields(fields, contractId, otherFormDO.getId(), partner);
|
||||
}
|
||||
}
|
||||
|
||||
// 收发港/站点
|
||||
if (reqVO.getGoodsSiteList() != null && !reqVO.getGoodsSiteList().isEmpty()) {
|
||||
for (GoodsSite goodsSite : reqVO.getGoodsSiteList()) {
|
||||
otherFormDO = saveContractOtherForm(contractId, "goodsSiteList",
|
||||
"收发港/站点", "收发港/站点");
|
||||
fields = goodsSite.getClass().getDeclaredFields();
|
||||
saveFields(fields, contractId, otherFormDO.getId(), goodsSite);
|
||||
}
|
||||
}
|
||||
|
||||
// 货物装卸要求
|
||||
if (reqVO.getLoadingRequirementsList() != null && !reqVO.getLoadingRequirementsList().isEmpty()) {
|
||||
for (LoadingRequirement loadingRequirement : reqVO.getLoadingRequirementsList()) {
|
||||
otherFormDO = saveContractOtherForm(contractId, "loadingRequirementsList",
|
||||
"货物装卸要求", "货物装卸要求");
|
||||
fields = loadingRequirement.getClass().getDeclaredFields();
|
||||
saveFields(fields, contractId, otherFormDO.getId(), loadingRequirement);
|
||||
}
|
||||
}
|
||||
|
||||
// 收付款账号
|
||||
if (reqVO.getAccountList() != null && !reqVO.getAccountList().isEmpty()) {
|
||||
for (Account account : reqVO.getAccountList()) {
|
||||
otherFormDO = saveContractOtherForm(contractId, "accountList",
|
||||
"收付款账号", "收付款账号");
|
||||
fields = account.getClass().getDeclaredFields();
|
||||
saveFields(fields, contractId, otherFormDO.getId(), account);
|
||||
}
|
||||
}
|
||||
|
||||
// 费用明细
|
||||
if (reqVO.getFreightList() != null && !reqVO.getFreightList().isEmpty()) {
|
||||
for (Freight freight : reqVO.getFreightList()) {
|
||||
otherFormDO = saveContractOtherForm(contractId, "freightList",
|
||||
"费用明细", "费用明细");
|
||||
fields = freight.getClass().getDeclaredFields();
|
||||
saveFields(fields, contractId, otherFormDO.getId(), freight);
|
||||
}
|
||||
}
|
||||
|
||||
// 服务费用项目
|
||||
if (reqVO.getServiceFeeList() != null && !reqVO.getServiceFeeList().isEmpty()) {
|
||||
for (ServiceFee serviceFee : reqVO.getServiceFeeList()) {
|
||||
otherFormDO = saveContractOtherForm(contractId, "serviceFeeList",
|
||||
"服务费用项目", "服务费用项目");
|
||||
fields = serviceFee.getClass().getDeclaredFields();
|
||||
saveFields(fields, contractId, otherFormDO.getId(), serviceFee);
|
||||
}
|
||||
}
|
||||
|
||||
// 仓库明细
|
||||
if (reqVO.getStorgeList() != null && !reqVO.getStorgeList().isEmpty()) {
|
||||
for (Storge storge : reqVO.getStorgeList()) {
|
||||
otherFormDO = saveContractOtherForm(contractId, "storgeList",
|
||||
"仓库明细", "仓库明细");
|
||||
fields = storge.getClass().getDeclaredFields();
|
||||
saveFields(fields, contractId, otherFormDO.getId(), storge);
|
||||
}
|
||||
}
|
||||
|
||||
// 接货地址
|
||||
if (reqVO.getReceivingAddrList() != null && !reqVO.getReceivingAddrList().isEmpty()) {
|
||||
for (ReceivingAddr receivingAddr : reqVO.getReceivingAddrList()) {
|
||||
otherFormDO = saveContractOtherForm(contractId, "receivingAddrList",
|
||||
"接货地址", "接货地址");
|
||||
fields = receivingAddr.getClass().getDeclaredFields();
|
||||
saveFields(fields, contractId, otherFormDO.getId(), receivingAddr);
|
||||
}
|
||||
}
|
||||
saveIntContractFields(reqVO, contractId);
|
||||
|
||||
return success(true);
|
||||
}
|
||||
|
||||
private void saveIntContractFields(IntContract reqVO, Long contractId) {
|
||||
|
||||
try {
|
||||
// 获取请求参数类结构
|
||||
Class<? extends IntContract> reqClass = reqVO.getClass();
|
||||
// 请求参数字段
|
||||
Field[] reqClassFields = reqClass.getDeclaredFields();
|
||||
|
||||
// 条款明细表保存集合
|
||||
List<ContractOtherFieldDO> saveFields = new ArrayList<>();
|
||||
|
||||
// 遍历字段
|
||||
for (Field reqClassField : reqClassFields) {
|
||||
|
||||
reqClassField.setAccessible(true);
|
||||
|
||||
// 获取字段说明
|
||||
Schema reqFieldSchema = reqClassField.getAnnotation(Schema.class);
|
||||
String reqFieldDesc = reqFieldSchema.description();
|
||||
|
||||
// 获取字段对象
|
||||
Object reqFieldObj = reqClassField.get(reqVO);
|
||||
if (reqFieldObj != null) {
|
||||
if (!"java.util.List".equals(reqClassField.getType().getName())) {
|
||||
// 基础类型字段保存到条款明细表
|
||||
ContractOtherFieldDO otherFieldDO = new ContractOtherFieldDO();
|
||||
otherFieldDO.setContractMainId(contractId.toString());
|
||||
otherFieldDO.setFieldNumber(reqClassField.getName());
|
||||
otherFieldDO.setFieldName(reqFieldDesc);
|
||||
otherFieldDO.setFieldValue(reqFieldObj.toString());
|
||||
otherFieldDO.setFieldDescription(reqFieldDesc);
|
||||
otherFieldDO.setType(reqClassField.getType().getName());
|
||||
saveFields.add(otherFieldDO);
|
||||
} else {
|
||||
// list类型字段保存到条款表,再将字段保存到条款明细表
|
||||
// 获取list类结构
|
||||
Class<?> listClass = reqClassField.get(reqVO).getClass();
|
||||
// 获取list迭代方法
|
||||
Method iteratorMethod = listClass.getMethod("iterator");
|
||||
// 获取迭代器
|
||||
Iterator<?> iterator = (Iterator<?>) iteratorMethod.invoke(reqClassField.get(reqVO));
|
||||
// 遍历
|
||||
while (iterator.hasNext()) {
|
||||
|
||||
// 条款表保存
|
||||
ContractOtherFormDO otherFormDO = new ContractOtherFormDO();
|
||||
otherFormDO.setContractMainId(contractId);
|
||||
otherFormDO.setFormNumber(reqClassField.getName());
|
||||
otherFormDO.setFormName(reqFieldDesc);
|
||||
otherFormDO.setFormDescription(reqFieldDesc);
|
||||
contractOtherFormMapper.insert(otherFormDO);
|
||||
|
||||
// 条款表ID
|
||||
Long otherFormDOId = otherFormDO.getId();
|
||||
|
||||
// 获取明细对象
|
||||
Object detailObj = iterator.next();
|
||||
// 获取明细对象类结构
|
||||
Class<?> detailClass = detailObj.getClass();
|
||||
|
||||
// 条款明细表
|
||||
if ("java.lang.String".equals(detailClass.getTypeName())) {
|
||||
// 基础类型对应生成一条明细
|
||||
ContractOtherFieldDO otherFieldDO = new ContractOtherFieldDO();
|
||||
otherFieldDO.setContractMainId(contractId.toString());
|
||||
otherFieldDO.setRelativityId(otherFormDOId);
|
||||
otherFieldDO.setFieldNumber(detailClass.getTypeName());
|
||||
otherFieldDO.setFieldName(reqFieldDesc);
|
||||
otherFieldDO.setFieldValue(detailObj.toString());
|
||||
otherFieldDO.setFieldDescription(reqFieldDesc);
|
||||
otherFieldDO.setType(detailClass.getTypeName());
|
||||
saveFields.add(otherFieldDO);
|
||||
} else {
|
||||
// 对象类型遍历字段保存对应明细
|
||||
Field[] detailClassFields = detailClass.getDeclaredFields();
|
||||
for (Field detailClassField : detailClassFields) {
|
||||
detailClassField.setAccessible(true);
|
||||
if (detailClassField.get(detailObj) != null) {
|
||||
ContractOtherFieldDO otherFieldDO = new ContractOtherFieldDO();
|
||||
otherFieldDO.setContractMainId(contractId.toString());
|
||||
otherFieldDO.setRelativityId(otherFormDOId);
|
||||
otherFieldDO.setFieldNumber(detailClassField.getName());
|
||||
otherFieldDO.setFieldName(detailClassField.getAnnotation(Schema.class).description());
|
||||
otherFieldDO.setFieldValue(detailClassField.get(detailObj).toString());
|
||||
otherFieldDO.setFieldDescription(detailClassField.getAnnotation(Schema.class).description());
|
||||
otherFieldDO.setType(detailClassField.getType().getName());
|
||||
saveFields.add(otherFieldDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 条款明细表集合批量保存
|
||||
if (!saveFields.isEmpty()) {
|
||||
contractOtherFieldMapper.insertBatch(saveFields);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
throw exception(CONTRACT_PUSH_FAIL, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PageResult<IntContract>> logisticsListPage(IntContractPageReq pageReq) {
|
||||
|
||||
@@ -496,7 +509,7 @@ public class ContractApiImpl implements ContractApi {
|
||||
return CommonResult.success(purchaseOrderDetails);
|
||||
}
|
||||
|
||||
private ContractMainDO getcontractMainDO(IntContract reqVO) {
|
||||
private ContractMainDO internationalToMainDO(IntContract reqVO) {
|
||||
|
||||
// 合同主信息表映射
|
||||
ContractMainDO contractMainDO = new ContractMainDO();
|
||||
@@ -575,43 +588,6 @@ public class ContractApiImpl implements ContractApi {
|
||||
return contractMainDO;
|
||||
}
|
||||
|
||||
private ContractOtherFormDO saveContractOtherForm(Long contractId, String formNumber, String formName, String formDescription) {
|
||||
ContractOtherFormDO otherFormDO = new ContractOtherFormDO();
|
||||
otherFormDO.setContractMainId(contractId);
|
||||
otherFormDO.setFormNumber(formNumber);
|
||||
otherFormDO.setFormName(formName);
|
||||
otherFormDO.setFormDescription(formDescription);
|
||||
contractOtherFormMapper.insert(otherFormDO);
|
||||
return otherFormDO;
|
||||
}
|
||||
|
||||
private ContractOtherFieldDO getContractOtherField(Long contractId, Long relativityId, String number, String name,
|
||||
String value, String description, String type) {
|
||||
ContractOtherFieldDO otherFieldDO = new ContractOtherFieldDO();
|
||||
otherFieldDO.setContractMainId(contractId.toString());
|
||||
otherFieldDO.setRelativityId(relativityId);
|
||||
otherFieldDO.setFieldNumber(number);
|
||||
otherFieldDO.setFieldName(name);
|
||||
otherFieldDO.setFieldValue(value);
|
||||
otherFieldDO.setFieldDescription(description);
|
||||
otherFieldDO.setType(type);
|
||||
return otherFieldDO;
|
||||
}
|
||||
|
||||
private <T> void saveFields(Field[] fields, Long contractId, Long relativityId, T obj) throws Exception {
|
||||
List<ContractOtherFieldDO> otherFieldDOS = new ArrayList<>();
|
||||
for (Field field : fields) {
|
||||
field.setAccessible(true);
|
||||
if (!"java.util.List".equals(field.getType().getName()) && field.get(obj) != null) {
|
||||
Schema annotation = field.getAnnotation(Schema.class);
|
||||
otherFieldDOS.add(getContractOtherField(contractId, relativityId, field.getName(),
|
||||
annotation.description(), field.get(obj).toString(),annotation.description(),
|
||||
field.getType().getName()));
|
||||
}
|
||||
}
|
||||
contractOtherFieldMapper.insertBatch(otherFieldDOS);
|
||||
}
|
||||
|
||||
private List<PurchaseOrderWithDetailsDTO> getSalesOrdDetailsByIds(List<Long> ids) {
|
||||
if (ids.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
|
||||
@@ -26,7 +26,6 @@ import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.error;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
import static com.zt.plat.module.contractorder.enums.ErrorCodeConstants.CONTRACT_PUSH_FAIL;
|
||||
import static com.zt.plat.module.contractorder.enums.ErrorCodeConstants.CONTRACT_SUBMIT_ERP_FAIL;
|
||||
|
||||
@Slf4j
|
||||
@@ -197,11 +196,7 @@ public class ContractController implements BusinessControllerMarker {
|
||||
@Operation(summary = "国贸2.0系统推送合同")
|
||||
@PreAuthorize("@ss.hasPermission('base:contract:create')")
|
||||
CommonResult<Boolean> push(@Valid @RequestBody IntContract reqVO) {
|
||||
try {
|
||||
return contractApi.push(reqVO);
|
||||
} catch (Exception e) {
|
||||
return error(CONTRACT_PUSH_FAIL, e.getMessage());
|
||||
}
|
||||
return contractApi.push(reqVO);
|
||||
}
|
||||
|
||||
@PostMapping("/logistics/list/page")
|
||||
|
||||
@@ -124,8 +124,8 @@ public class PurchaseOrderController implements BusinessControllerMarker {
|
||||
@PostMapping("/submit-order")
|
||||
@Operation(summary = "提交订单审核")
|
||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:update')")
|
||||
public CommonResult<Boolean> submitOrder(@RequestParam("id") Long id) {
|
||||
purchaseOrderService.submitOrder(id);
|
||||
public CommonResult<Boolean> submitOrder(@RequestParam("id") String id) {
|
||||
purchaseOrderService.submitOrder(Long.valueOf(id));
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@@ -142,15 +142,22 @@ public class PurchaseOrderController implements BusinessControllerMarker {
|
||||
@PostMapping("/submit-erp061")
|
||||
@Operation(summary = "推送ERP订单", description = "061')")
|
||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:update')")
|
||||
public CommonResult<?> submitErp061(@RequestBody @Validated @NotEmpty(message = "采购订单id不能为空") List<Long> ids) {
|
||||
return success(purchaseOrderService.submitErp061(ids));
|
||||
public CommonResult<?> submitErp061(@RequestBody @Validated @NotEmpty(message = "采购订单id不能为空") List<String> idsStr) {
|
||||
List<Long> ids = idsStr.stream().map(Long::valueOf).toList();
|
||||
// TODO 推送ERP订单
|
||||
// purchaseOrderService.submitErp061(ids);
|
||||
//随机生成六位数
|
||||
|
||||
return success(R());
|
||||
}
|
||||
|
||||
@PostMapping("/submit-erp062")
|
||||
@Operation(summary = "推送ERP订单", description = "062当每次调更新接口后都需要调此接口")
|
||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:update')")
|
||||
public CommonResult<?> submitErp062(@RequestParam @Validated @NotNull(message = "采购订单id不能为空") Long id) {
|
||||
return success(purchaseOrderService.submitErp062(id));
|
||||
public CommonResult<?> submitErp062(@RequestParam @Validated @NotNull(message = "采购订单id不能为空") String id) {
|
||||
//TODO 推送ERP订单
|
||||
|
||||
return success(R());
|
||||
}
|
||||
|
||||
//通过订单号查询订单信息
|
||||
@@ -205,4 +212,9 @@ public class PurchaseOrderController implements BusinessControllerMarker {
|
||||
public CommonResult<List<PurchaseOrderRespVO>> boundOrder(@RequestBody DownOrUpOrderReqVO reqVO) {
|
||||
return success(purchaseOrderService.getBindOrderByOrder(reqVO));
|
||||
}
|
||||
|
||||
private String R(){
|
||||
int number = (int) (Math.random() * 900000 + 100000);
|
||||
return String.valueOf(number);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class SalesOrderDetailPageReqVO extends PageParam {
|
||||
private String warehouseNumber;
|
||||
|
||||
@Schema(description = "计量单位;推送ERP(必须)")
|
||||
private String unit;
|
||||
private String unt;
|
||||
|
||||
@Schema(description = "开票类型;推送ERP(必须)", example = "2")
|
||||
private String invoiceType;
|
||||
|
||||
@@ -77,7 +77,7 @@ public class SalesOrderDetailDO extends BusinessBaseDO {
|
||||
* 计量单位;推送ERP(必须)
|
||||
*/
|
||||
@TableField("UNT")
|
||||
private String unit;
|
||||
private String unt;
|
||||
/**
|
||||
* 开票类型;推送ERP(必须)
|
||||
*/
|
||||
|
||||
@@ -44,6 +44,7 @@ public interface PurchaseOrderMapper extends BaseMapperX<PurchaseOrderDO> {
|
||||
.eqIfPresent(PurchaseOrderDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(PurchaseOrderDO::getAgentNumber, reqVO.getAgentNumber())
|
||||
.likeIfPresent(PurchaseOrderDO::getAgentName, reqVO.getAgentName())
|
||||
.eqIfPresent(PurchaseOrderDO::getMtrlTp, reqVO.getMtrlTp())
|
||||
// .eqIfPresent(PurchaseOrderDO::getOrderNumber, reqVO.getOrderNumber())
|
||||
.eqIfPresent(PurchaseOrderDO::getContractNumber, reqVO.getContractNumber())
|
||||
.eqIfPresent(PurchaseOrderDO::getMaterialNumber, reqVO.getMaterialNumber())
|
||||
@@ -57,13 +58,16 @@ public interface PurchaseOrderMapper extends BaseMapperX<PurchaseOrderDO> {
|
||||
.likeIfPresent(PurchaseOrderDO::getErpSalesCompanyName, reqVO.getErpSalesCompanyName())
|
||||
.likeIfPresent(PurchaseOrderDO::getPurchaseOrganizationName, reqVO.getPurchaseOrganizationName())
|
||||
.eqIfPresent(PurchaseOrderDO::getErpStatus, reqVO.getErpStatus())
|
||||
.eqIfPresent(PurchaseOrderDO::getSplyBsnTp, reqVO.getSplyBsnTp()!=null?reqVO.getSplyBsnTp():"PUR")
|
||||
.eqIfPresent(PurchaseOrderDO::getSplyBsnTp, reqVO.getSplyBsnTp() != null ? reqVO.getSplyBsnTp() : "PUR")
|
||||
.eqIfPresent(PurchaseOrderDO::getCause, reqVO.getCause())
|
||||
.eqIfPresent(PurchaseOrderDO::getStatus, reqVO.getStatus())
|
||||
.likeIfPresent(PurchaseOrderDO::getPurchaseGroupName, reqVO.getPurchaseGroupName())
|
||||
.orderByDesc(PurchaseOrderDO::getId));
|
||||
}
|
||||
|
||||
List<PurchaseOrderWithDetailsVO> selectOrderByOrderNos(@Param("orderNos") List<String> orderNos);
|
||||
|
||||
List<PurchaseOrderWithDetailsVO> selectOrderByIds(@Param("ids") List<Long> id);
|
||||
|
||||
PurchaseOrderDO selectByOrderId(@Param("orderId") Long orderId);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public interface SalesOrderDetailMapper extends BaseMapperX<SalesOrderDetailDO>
|
||||
.eqIfPresent(SalesOrderDetailDO::getFactoryNumber, reqVO.getFactoryNumber())
|
||||
.likeIfPresent(SalesOrderDetailDO::getWarehouseName, reqVO.getWarehouseName())
|
||||
.eqIfPresent(SalesOrderDetailDO::getWarehouseNumber, reqVO.getWarehouseNumber())
|
||||
.eqIfPresent(SalesOrderDetailDO::getUnit, reqVO.getUnit())
|
||||
.eqIfPresent(SalesOrderDetailDO::getUnt, reqVO.getUnt())
|
||||
.eqIfPresent(SalesOrderDetailDO::getInvoiceType, reqVO.getInvoiceType())
|
||||
.eqIfPresent(SalesOrderDetailDO::getQuantity, reqVO.getQuantity())
|
||||
.eqIfPresent(SalesOrderDetailDO::getTaxAcctasscat, reqVO.getTaxAcctasscat())
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
|
||||
import com.zt.plat.module.contractorder.controller.admin.salesorder.vo.SalesOrderPageReqVO;
|
||||
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 org.apache.ibatis.annotations.Mapper;
|
||||
@@ -45,6 +46,7 @@ public interface SalesOrderMapper extends BaseMapperX<SalesOrderDO> {
|
||||
.likeIfPresent(SalesOrderDO::getSaleAcsName, reqVO.getSaleAcsName())
|
||||
.eqIfPresent(SalesOrderDO::getSaleAcsCdg, reqVO.getSaleAcsCdg())
|
||||
.likeIfPresent(SalesOrderDO::getPdtGrpName, reqVO.getPdtGrpName())
|
||||
.eqIfPresent(SalesOrderDO::getMtrlTp, reqVO.getMtrlTp())
|
||||
.likeIfPresent(SalesOrderDO::getPdtGrpCdg, reqVO.getPdtGrpCdg())
|
||||
.eqIfPresent(SalesOrderDO::getContractNumber, reqVO.getContractNumber())
|
||||
.eqIfPresent(SalesOrderDO::getMaterialNumber, reqVO.getMaterialNumber())
|
||||
|
||||
@@ -921,8 +921,10 @@ public class ContractServiceImpl implements ContractService {
|
||||
}
|
||||
|
||||
// 更新合同主信息
|
||||
Long instanceId = newContractMainDO.getInstanceId();
|
||||
newContractMainDO.setInstanceId(null);
|
||||
contractMainMapper.update(newContractMainDO, new LambdaUpdateWrapper<>(ContractMainDO.class)
|
||||
.set(ContractMainDO::getInstanceId, newContractMainDO.getInstanceId())
|
||||
.set(ContractMainDO::getInstanceId, instanceId)
|
||||
.eq(ContractMainDO::getId, newContractMainDO.getId()));
|
||||
|
||||
if (DictEnum.BSE_CTRT_STS_IN_PROGRESS.getCode().equals(newContractMainDO.getStatus())) {
|
||||
|
||||
@@ -95,13 +95,12 @@ public class SalesOrderServiceImpl implements SalesOrderService {
|
||||
//订单号
|
||||
//生成订单号
|
||||
if (Objects.equals(createReqVO.getIsPush(), 1)) {
|
||||
createReqVO.setStatus(OrderStatusEnum.DRAFT.getCode()); //设置初始状态
|
||||
salesOrderDO.setStatus(OrderStatusEnum.DRAFT.getCode()); //设置初始状态
|
||||
} else {
|
||||
createReqVO.setStatus(OrderStatusEnum.TO_SUBMIT_ERP.getCode());
|
||||
salesOrderDO.setStatus(OrderStatusEnum.TO_SUBMIT_ERP.getCode());
|
||||
}
|
||||
String orderNumber = generateOrderNumber(salesOrderDO.getMtrlTp());
|
||||
salesOrderDO.setSystemOrderNumber(orderNumber);
|
||||
salesOrderDO.setStatus(OrderStatusEnum.DRAFT.getCode());
|
||||
salesOrderMapper.insert(salesOrderDO);
|
||||
// 返回
|
||||
return BeanUtils.toBean(salesOrderDO, SalesOrderRespVO.class);
|
||||
@@ -534,7 +533,7 @@ public class SalesOrderServiceImpl implements SalesOrderService {
|
||||
private String getStatusByBpmProcessInstanceCode(Integer code) {
|
||||
return Optional.ofNullable(code)
|
||||
.map(c -> switch (c) {
|
||||
case -1, 3, 4 -> OrderStatusEnum.DRAFT.getCode();
|
||||
case -1, 3, 4 -> OrderStatusEnum.REJECTED.getCode();
|
||||
case 1 -> OrderStatusEnum.APPROVING.getCode();
|
||||
case 2 -> OrderStatusEnum.TO_SUBMIT_ERP.getCode();
|
||||
default -> throw new IllegalArgumentException("未定义的BPM状态码:" + c);
|
||||
|
||||
Reference in New Issue
Block a user