Commit 55489fa962fd7af34ecd68a1f2eeb804f6c2091e

Authored by 房远帅
1 parent 7daf9de0

1:订货单、撤销单、规格变更单查询接口增加合同类型方便前端判断单位是元还是美元 2:合同锁规可以编辑备注 3:订单明细报表赋值订单类型 经销标准合同-经销 经销…

…库存、外贸库存合同-库存已锁价、库存未锁价 经销未锁规、外贸未锁规合同-未锁规、已锁规 加工标准合同-加工 外贸标准合同-外贸
... ... @@ -409,7 +409,7 @@ CREATE TABLE IF NOT EXISTS `tbl_purchase_order_revoke_line`
409 409 `length_tol_neg` decimal(10, 4) DEFAULT NULL COMMENT '长度公差负',
410 410 `status` varchar(50) DEFAULT NULL COMMENT '状态',
411 411 `quantity` decimal(15, 4) NOT NULL COMMENT '原数量kg',
412   - `sales_price` decimal(15, 4) NOT NULL COMMENT '销售价格',
  412 + `sales_price` decimal(15, 4) DEFAULT NULL COMMENT '销售价格',
413 413 `delivery_date` date DEFAULT NULL COMMENT '发货日期',
414 414 `revoke_quantity` decimal(15, 4) DEFAULT NULL COMMENT '撤销数量',
415 415 `show_order` int DEFAULT '0' COMMENT '排序',
... ...
... ... @@ -145,6 +145,12 @@ public class GetPurchaseOrderRevokeBo extends BaseBo<PurchaseOrderRevoke> {
145 145 @ApiModelProperty("订货单撤销表物料行")
146 146 private List<PurchaseOrderRevokeLine> purchaseOrderRevokeLineList;
147 147
  148 + /**
  149 + * 合同类型
  150 + */
  151 + @ApiModelProperty("合同类型")
  152 + private String contractType;
  153 +
148 154 public GetPurchaseOrderRevokeBo() {
149 155
150 156 }
... ...
... ... @@ -260,6 +260,12 @@ public class OrderChangeRecordBo extends BaseBo<OrderInfoChangeRecord> {
260 260 @ApiModelProperty("是否是变更发起人")
261 261 private Boolean changeCreateBy;
262 262
  263 + /**
  264 + * 合同类型
  265 + */
  266 + @ApiModelProperty("合同类型")
  267 + private String contractType;
  268 +
263 269
264 270 public OrderChangeRecordBo() {
265 271
... ...
... ... @@ -152,6 +152,12 @@ public class GetReplenishmentOrderBo extends BaseBo<ReplenishmentOrder> {
152 152 @ApiModelProperty("补货单物料行")
153 153 private List<GetReplenishmentOrderLineBo> replenishmentOrderLineList;
154 154
  155 + /**
  156 + * 合同类型
  157 + */
  158 + @ApiModelProperty("合同类型")
  159 + private String contractType;
  160 +
155 161 public GetReplenishmentOrderBo() {
156 162
157 163 }
... ...
... ... @@ -5,9 +5,13 @@ import com.lframework.starter.web.core.annotations.security.HasPermission;
5 5 import com.lframework.starter.web.core.controller.DefaultBaseController;
6 6 import com.lframework.starter.web.core.utils.JsonUtil;
7 7 import com.lframework.xingyun.sc.bo.order.change.OrderChangeRecordBo;
  8 +import com.lframework.xingyun.sc.entity.ContractDistributorStandard;
8 9 import com.lframework.xingyun.sc.entity.OrderInfoChangeRecord;
  10 +import com.lframework.xingyun.sc.entity.PurchaseOrderInfo;
9 11 import com.lframework.xingyun.sc.entity.PurchaseOrderLine;
10 12 import com.lframework.xingyun.sc.enums.OrderSpecChangeStatus;
  13 +import com.lframework.xingyun.sc.service.contract.ContractDistributorStandardService;
  14 +import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
11 15 import com.lframework.xingyun.sc.utils.ExcelUtil;
12 16 import com.lframework.xingyun.sc.utils.LatexFormulaExcelExporterUtil;
13 17 import com.lframework.xingyun.sc.utils.ResponseUtil;
... ... @@ -60,6 +64,10 @@ public class OrderChangeRecordController extends DefaultBaseController {
60 64
61 65 @Resource
62 66 private OrderChangeRecordService orderChangeRecordService;
  67 + @Resource
  68 + private PurchaseOrderInfoService purchaseOrderInfoService;
  69 + @Resource
  70 + private ContractDistributorStandardService contractDistributorStandardService;
63 71
64 72 /**
65 73 * 查询列表
... ... @@ -90,6 +98,16 @@ public class OrderChangeRecordController extends DefaultBaseController {
90 98 throw new DefaultClientException("订货单变更记录不存在!");
91 99 }
92 100 OrderChangeRecordBo result = new OrderChangeRecordBo(data);
  101 + PurchaseOrderInfo purchaseOrderInfo = purchaseOrderInfoService.findById(result.getOrderId());
  102 + if (purchaseOrderInfo != null) {
  103 + String contractId = purchaseOrderInfo.getContractId();
  104 + if (StringUtils.isNotEmpty(contractId)) {
  105 + ContractDistributorStandard contractDistributorStandard = contractDistributorStandardService.findById(contractId);
  106 + if (contractDistributorStandard != null) {
  107 + result.setContractType(contractDistributorStandard.getType());
  108 + }
  109 + }
  110 + }
93 111
94 112 return InvokeResultBuilder.success(result);
95 113 }
... ...
... ... @@ -16,6 +16,7 @@ import javax.validation.constraints.NotBlank;
16 16 import com.lframework.xingyun.sc.bo.order.GetPurchaseOrderInfoBo;
17 17 import com.lframework.xingyun.sc.bo.order.GetPurchaseOrderRevokeBo;
18 18 import com.lframework.xingyun.sc.entity.*;
  19 +import com.lframework.xingyun.sc.service.contract.ContractDistributorStandardService;
19 20 import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
20 21 import com.lframework.xingyun.sc.service.order.PurchaseOrderLineService;
21 22 import com.lframework.xingyun.sc.service.order.PurchaseOrderRevokeLineService;
... ... @@ -28,6 +29,7 @@ import io.swagger.annotations.ApiOperation;
28 29 import com.lframework.starter.common.utils.CollectionUtil;
29 30 import io.swagger.annotations.Api;
30 31 import org.apache.commons.collections.CollectionUtils;
  32 +import org.apache.commons.lang3.StringUtils;
31 33 import org.springframework.web.bind.annotation.DeleteMapping;
32 34 import org.springframework.beans.factory.annotation.Autowired;
33 35 import org.springframework.validation.annotation.Validated;
... ... @@ -58,6 +60,8 @@ public class PurchaseOrderRevokeController extends DefaultBaseController {
58 60 private PurchaseOrderRevokeLineService purchaseOrderRevokeLineService;
59 61 @Resource
60 62 private FlowTaskWrapperMapper flowTaskWrapperMapper;
  63 + @Resource
  64 + private ContractDistributorStandardService contractDistributorStandardService;
61 65
62 66 /**
63 67 * 查询列表
... ... @@ -124,6 +128,16 @@ public class PurchaseOrderRevokeController extends DefaultBaseController {
124 128 if (CollectionUtil.isNotEmpty(query)) {
125 129 result.setPurchaseOrderRevokeLineList(query);
126 130 }
  131 + PurchaseOrderInfo purchaseOrderInfo = purchaseOrderInfoService.findById(data.getPurchaseOrderId());
  132 + if (purchaseOrderInfo != null) {
  133 + String contractId = purchaseOrderInfo.getContractId();
  134 + if (StringUtils.isNotEmpty(contractId)) {
  135 + ContractDistributorStandard contractDistributorStandard = contractDistributorStandardService.findById(contractId);
  136 + if (contractDistributorStandard != null) {
  137 + result.setContractType(contractDistributorStandard.getType());
  138 + }
  139 + }
  140 + }
127 141
128 142 return InvokeResultBuilder.success(result);
129 143 }
... ...
... ... @@ -26,9 +26,11 @@ import com.lframework.xingyun.basedata.vo.customer.QueryCustomerVo;
26 26 import com.lframework.xingyun.sc.bo.purchase.GetReplenishmentOrderBo;
27 27 import com.lframework.xingyun.sc.bo.purchase.GetReplenishmentOrderLineBo;
28 28 import com.lframework.xingyun.sc.bo.purchase.QueryReplenishmentOrderBo;
  29 +import com.lframework.xingyun.sc.entity.ContractDistributorStandard;
29 30 import com.lframework.xingyun.sc.entity.PurchaseOrderInfo;
30 31 import com.lframework.xingyun.sc.entity.ReplenishmentOrder;
31 32 import com.lframework.xingyun.sc.entity.ReplenishmentOrderLine;
  33 +import com.lframework.xingyun.sc.service.contract.ContractDistributorStandardService;
32 34 import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
33 35 import com.lframework.xingyun.sc.service.purchase.ReplenishmentOrderLineService;
34 36 import com.lframework.xingyun.sc.service.purchase.ReplenishmentOrderService;
... ... @@ -77,6 +79,8 @@ public class ReplenishmentOrderController extends DefaultBaseController {
77 79 private ReplenishmentOrderLineService replenishmentOrderLineService;
78 80 @Resource
79 81 private FlowTaskWrapperMapper flowTaskWrapperMapper;
  82 + @Resource
  83 + private ContractDistributorStandardService contractDistributorStandardService;
80 84
81 85
82 86 public static final String AUDIT_STATUS_DIC_CODE = "AUDIT_STATUS"; // 审核状态
... ... @@ -195,6 +199,13 @@ public class ReplenishmentOrderController extends DefaultBaseController {
195 199 result.setStatusName(sysDataDicItem == null ? "" : sysDataDicItem.getName());
196 200 PurchaseOrderInfo purchaseOrderInfo = purchaseOrderInfoService.findById(data.getPurchaseOrderId());
197 201 result.setPurchaseOrderName(purchaseOrderInfo == null ? "" : purchaseOrderInfo.getOrderNo());
  202 + String contractId = purchaseOrderInfo.getContractId();
  203 + if (StringUtils.isNotEmpty(contractId)) {
  204 + ContractDistributorStandard contractDistributorStandard = contractDistributorStandardService.findById(contractId);
  205 + if (contractDistributorStandard != null) {
  206 + result.setContractType(contractDistributorStandard.getType());
  207 + }
  208 + }
198 209
199 210 Wrapper<ReplenishmentOrderLine> lineWrapper = Wrappers.lambdaQuery(ReplenishmentOrderLine.class)
200 211 .eq(ReplenishmentOrderLine::getReplenishmentOrderId, id)
... ...
... ... @@ -1455,6 +1455,7 @@ public class ContractDistributorStandardServiceImpl extends
1455 1455 data.setPerformance(vo.getPerformance());
1456 1456 data.setComponent(vo.getComponent());
1457 1457 data.setPackaging(vo.getPackaging());
  1458 + data.setRemarks(vo.getRemarks());
1458 1459 // data.setStandardizedAt(LocalDateTime.now());
1459 1460 getBaseMapper().insert(data);
1460 1461
... ...
... ... @@ -36,6 +36,7 @@ import com.lframework.xingyun.sc.service.customer.CustomerCreditService;
36 36 import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
37 37 import com.lframework.xingyun.sc.service.order.PurchaseOrderLineService;
38 38 import com.lframework.xingyun.sc.service.statistics.OrderDetailReportService;
  39 +import com.lframework.xingyun.sc.utils.OrderDetailReportUtil;
39 40 import com.lframework.xingyun.sc.vo.order.CreatePurchaseOrderLineVo;
40 41 import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderInfoVo;
41 42 import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderLineVo;
... ... @@ -586,7 +587,8 @@ public class OrderChangeRecordServiceImpl extends BaseMpServiceImpl<OrderChangeR
586 587 vo.setQuality(line.getQuality());
587 588 vo.setContractType(orderDetailReport.getContractType());
588 589 vo.setStockUpCompanyName(orderInfo.getStockUpCompanyName());
589   - //vo.setOrderType();
  590 + vo.setType(orderInfo.getType());
  591 + vo.setOrderType(OrderDetailReportUtil.buildOrderType(type, orderInfo.getType()));
590 592 vo.setShowOrder(2);
591 593 vo.setCreateById(contractCreateById);
592 594 orderDetailReportService.create(vo);
... ...
... ... @@ -38,6 +38,7 @@ import com.lframework.xingyun.sc.service.customer.CustomerCreditService;
38 38 import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
39 39 import com.lframework.xingyun.sc.service.order.PurchaseOrderLineService;
40 40 import com.lframework.xingyun.sc.service.statistics.OrderDetailReportService;
  41 +import com.lframework.xingyun.sc.utils.OrderDetailReportUtil;
41 42 import com.lframework.xingyun.sc.vo.customer.credit.QueryCustomerCreditVo;
42 43 import com.lframework.xingyun.sc.vo.order.*;
43 44 import com.lframework.xingyun.sc.vo.statistics.orderDetail.CreateOrderDetailReportVo;
... ... @@ -416,7 +417,7 @@ public class PurchaseOrderInfoServiceImpl extends BaseMpServiceImpl<PurchaseOrde
416 417 }
417 418 }
418 419 vo.setStockUpCompanyName(purchaseOrderInfo.getStockUpCompanyName());
419   -// vo.setOrderType();
  420 + vo.setOrderType(OrderDetailReportUtil.buildOrderType(type, purchaseOrderInfo.getType()));
420 421 vo.setShowOrder(0);
421 422 vo.setType(purchaseOrderInfo.getType());
422 423 vo.setCreateById(purchaseOrderInfo.getContractCreateById());
... ...
... ... @@ -26,6 +26,7 @@ import com.lframework.xingyun.sc.service.customer.CustomerCreditService;
26 26 import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
27 27 import com.lframework.xingyun.sc.service.order.PurchaseOrderLineService;
28 28 import com.lframework.xingyun.sc.service.statistics.OrderDetailReportService;
  29 +import com.lframework.xingyun.sc.utils.OrderDetailReportUtil;
29 30 import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderInfoVo;
30 31 import com.lframework.xingyun.sc.vo.order.QueryPurchaseOrderLineVo;
31 32 import com.lframework.xingyun.sc.vo.statistics.orderDetail.CreateOrderDetailReportVo;
... ... @@ -408,7 +409,7 @@ public class OrderDetailReportServiceImpl extends BaseMpServiceImpl<OrderDetailR
408 409 }
409 410 }
410 411 vo.setStockUpCompanyName(purchaseOrderInfo.getStockUpCompanyName());
411   - //vo.setOrderType();
  412 + vo.setOrderType(OrderDetailReportUtil.buildOrderType(type, purchaseOrderInfo.getType()));
412 413 vo.setShowOrder(0);
413 414 vo.setType(purchaseOrderInfo.getType());
414 415 vo.setCreateById(purchaseOrderInfo.getContractCreateById());
... ...
  1 +package com.lframework.xingyun.sc.utils;
  2 +
  3 +/**
  4 + * 订单明细报表工具类。
  5 + */
  6 +public final class OrderDetailReportUtil {
  7 +
  8 + private OrderDetailReportUtil() {
  9 + }
  10 +
  11 + /**
  12 + * 根据合同类型和订货单类型构建订单类型展示值。
  13 + *
  14 + * @param contractType 合同类型
  15 + * @param purchaseOrderType 订货单类型
  16 + * @return 订单类型展示值
  17 + */
  18 + public static String buildOrderType(String contractType, String purchaseOrderType) {
  19 + if ("DISTRIB_STD".equals(contractType)) {
  20 + return "经销";
  21 + }
  22 + if ("INTL_STD_CONTRACT".equals(contractType)) {
  23 + return "外贸";
  24 + }
  25 + if ("PROCESS_STD_AGMT".equals(contractType)) {
  26 + return "加工";
  27 + }
  28 + if ("DIST_STOCK_CONTRACT".equals(contractType) || "INTL_INVENTORY_AGMT".equals(contractType)) {
  29 + if ("NO_PRODUCTION".equals(purchaseOrderType)) {
  30 + return "库存已锁价";
  31 + }
  32 + if ("PRODUCTION".equals(purchaseOrderType)) {
  33 + return "库存未锁价";
  34 + }
  35 + return "库存";
  36 + }
  37 + if ("DRAFT_DIST_AGMT".equals(contractType) || "INTL_OPEN_SPEC_AGMT".equals(contractType)) {
  38 + if ("NO_PRODUCTION".equals(purchaseOrderType)) {
  39 + return "未锁规";
  40 + }
  41 + if ("PRODUCTION".equals(purchaseOrderType)) {
  42 + return "已锁规";
  43 + }
  44 + return "未锁规";
  45 + }
  46 + return "";
  47 + }
  48 +}
... ...