Commit d9c7edda57be9d3a6abb9b0a1d68807f7f9ebf83
Merge branch 'master_cj_zq' into master_sample_order
# Conflicts: # xingyun-api/src/main/resources/db/chujiang/base.sql # xingyun-sc/src/main/java/com/lframework/xingyun/sc/entity/PurchaseOrderLine.java # xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/contract/ContractDistributorStandardServiceImpl.java # xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/order/PurchaseOrderLineServiceImpl.java # xingyun-sc/src/main/java/com/lframework/xingyun/sc/vo/order/CreatePurchaseOrderLineVo.java # xingyun-sc/src/main/resources/mappers/order/PurchaseOrderLineMapper.xml
Showing
6 changed files
with
30 additions
and
4 deletions
| ... | ... | @@ -1231,3 +1231,6 @@ ALTER TABLE purchase_order_info |
| 1231 | 1231 | ALTER TABLE tbl_purchase_order_line |
| 1232 | 1232 | ADD COLUMN sample_order boolean DEFAULT FALSE COMMENT '是否为试样订单'; |
| 1233 | 1233 | |
| 1234 | + | |
| 1235 | + | |
| 1236 | +alter table tbl_purchase_order_line add column contract_distributor_line_id varchar(32) DEFAULT NULL comment '合同物料行ID'; | ... | ... |
| ... | ... | @@ -265,6 +265,11 @@ public class PurchaseOrderLine extends BaseEntity implements BaseDto { |
| 265 | 265 | private Boolean delFlag; |
| 266 | 266 | |
| 267 | 267 | /** |
| 268 | + * 合同物料行ID | |
| 269 | + */ | |
| 270 | + private String contractDistributorLineId; | |
| 271 | + | |
| 272 | + /** | |
| 268 | 273 | * 是否为试样订单 |
| 269 | 274 | */ |
| 270 | 275 | private boolean sampleOrder; | ... | ... |
| ... | ... | @@ -731,6 +731,7 @@ public class ContractDistributorStandardServiceImpl extends |
| 731 | 731 | createPurchaseOrderLineVo.setSalesPrice(contractDistributorLine.getUnitPrice()); |
| 732 | 732 | createPurchaseOrderLineVo.setDeliveryDate(contractDistributorLine.getDeliveryDate()); |
| 733 | 733 | createPurchaseOrderLineVo.setShowOrder(contractDistributorLine.getShowOrder()); |
| 734 | + createPurchaseOrderLineVo.setContractDistributorLineId(contractDistributorLine.getId()); | |
| 734 | 735 | createPurchaseOrderLineVo.setSampleOrder(contractDistributorLine.getSampleOrder()); |
| 735 | 736 | createPurchaseOrderLineVoList.add(createPurchaseOrderLineVo); |
| 736 | 737 | }); |
| ... | ... | @@ -757,6 +758,7 @@ public class ContractDistributorStandardServiceImpl extends |
| 757 | 758 | createPurchaseOrderLineVo.setDeliveryDate(contractStdProcessingLine.getDeliveryDate()); |
| 758 | 759 | createPurchaseOrderLineVo.setShowOrder(contractStdProcessingLine.getShowOrder()); |
| 759 | 760 | createPurchaseOrderLineVo.setSampleOrder(contractStdProcessingLine.getSampleOrder()); |
| 761 | + createPurchaseOrderLineVo.setContractDistributorLineId(contractStdProcessingLine.getId()); | |
| 760 | 762 | createPurchaseOrderLineVoList.add(createPurchaseOrderLineVo); |
| 761 | 763 | }); |
| 762 | 764 | } |
| ... | ... | @@ -1086,9 +1088,14 @@ public class ContractDistributorStandardServiceImpl extends |
| 1086 | 1088 | |
| 1087 | 1089 | for (int index = 0; index < purchaseOrderLineList.size(); index++) { |
| 1088 | 1090 | PurchaseOrderLine oldLine = purchaseOrderLineList.get(index); |
| 1089 | - UpdateContractDistributorLineVo contractDistributorLine = vo.getContractDistributorLineList().get(index); | |
| 1091 | + Map<String, BigDecimal> map = vo.getContractDistributorLineList().stream() | |
| 1092 | + .collect(Collectors.toMap( | |
| 1093 | + UpdateContractDistributorLineVo::getId, | |
| 1094 | + UpdateContractDistributorLineVo::getUnitPrice, | |
| 1095 | + (existing, replacement) -> replacement // 保留后者 | |
| 1096 | + )); | |
| 1090 | 1097 | Wrapper<PurchaseOrderLine> updateOrderLineWrapper = Wrappers.lambdaUpdate(PurchaseOrderLine.class) |
| 1091 | - .set(PurchaseOrderLine::getSalesPrice, contractDistributorLine.getUnitPrice()) | |
| 1098 | + .set(PurchaseOrderLine::getSalesPrice, map.get(oldLine.getContractDistributorLineId())) | |
| 1092 | 1099 | .eq(PurchaseOrderLine::getId, oldLine.getId()); |
| 1093 | 1100 | purchaseOrderLineService.update(updateOrderLineWrapper); |
| 1094 | 1101 | } | ... | ... |
| ... | ... | @@ -128,6 +128,9 @@ public class PurchaseOrderLineServiceImpl extends BaseMpServiceImpl<PurchaseOrde |
| 128 | 128 | if (vo.getPackagingFee() != null) { |
| 129 | 129 | data.setPackagingFee(vo.getPackagingFee()); |
| 130 | 130 | } |
| 131 | + if (!StringUtil.isBlank(vo.getContractDistributorLineId())) { | |
| 132 | + data.setContractDistributorLineId(vo.getContractDistributorLineId()); | |
| 133 | + } | |
| 131 | 134 | data.setSampleOrder(vo.isSampleOrder()); |
| 132 | 135 | |
| 133 | 136 | getBaseMapper().insert(data); | ... | ... |
| ... | ... | @@ -177,6 +177,12 @@ public class CreatePurchaseOrderLineVo implements BaseVo, Serializable { |
| 177 | 177 | private BigDecimal packagingFee; |
| 178 | 178 | |
| 179 | 179 | /** |
| 180 | + * 合同物料行ID | |
| 181 | + */ | |
| 182 | + @ApiModelProperty("合同物料行ID") | |
| 183 | + private String contractDistributorLineId; | |
| 184 | + | |
| 185 | + /** | |
| 180 | 186 | * 是否为试样订单 |
| 181 | 187 | */ |
| 182 | 188 | @ApiModelProperty("是否为试样订单") | ... | ... |
| ... | ... | @@ -26,6 +26,7 @@ |
| 26 | 26 | <result column="assessment_exceeds_agreement" property="assessmentExceedsAgreement"/> |
| 27 | 27 | <result column="packaging_fee" property="packagingFee"/> |
| 28 | 28 | <result column="shipment" property="shipment"/> |
| 29 | + <result column="contract_distributor_line_id" property="contractDistributorLineId"/> | |
| 29 | 30 | <result column="sample_order" property="sampleOrder"/> |
| 30 | 31 | <result column="create_by_id" property="createById"/> |
| 31 | 32 | <result column="create_by" property="createBy"/> |
| ... | ... | @@ -60,6 +61,7 @@ |
| 60 | 61 | tb.assessment_exceeds_agreement, |
| 61 | 62 | tb.packaging_fee, |
| 62 | 63 | tb.shipment, |
| 64 | + tb.contract_distributor_line_id, | |
| 63 | 65 | tb.sample_order, |
| 64 | 66 | tb.create_by_id, |
| 65 | 67 | tb.create_by, |
| ... | ... | @@ -98,7 +100,7 @@ |
| 98 | 100 | length, length_tol_pos, length_tol_neg, |
| 99 | 101 | status, quantity, sales_price, delivery_date, show_order, |
| 100 | 102 | assessment_exceeds_agreement, create_by_id, create_by, update_by_id, update_by, |
| 101 | - create_time, update_time, parent_id,packaging_fee,sample_order | |
| 103 | + create_time, update_time, parent_id,packaging_fee,contract_distributor_line_id,sample_order | |
| 102 | 104 | ) VALUES |
| 103 | 105 | <foreach collection="specList" item="item" separator=","> |
| 104 | 106 | ( |
| ... | ... | @@ -108,7 +110,7 @@ |
| 108 | 110 | #{item.length}, #{item.lengthTolPos}, #{item.lengthTolNeg}, |
| 109 | 111 | #{item.status}, #{item.quantity}, #{item.salesPrice}, #{item.deliveryDate}, #{item.showOrder}, |
| 110 | 112 | #{item.assessmentExceedsAgreement}, #{item.createById}, #{item.createBy}, #{item.updateById}, #{item.updateBy}, |
| 111 | - #{item.createTime}, #{item.updateTime}, #{item.parentId},#{item.packagingFee},#{sampleOrder} | |
| 113 | + #{item.createTime}, #{item.updateTime}, #{item.parentId},#{item.packagingFee},#{item.contractDistributorLineId},#{sampleOrder} | |
| 112 | 114 | ) |
| 113 | 115 | </foreach> |
| 114 | 116 | </insert> | ... | ... |