Commit 2f368126e3ab21c89458bcb268b4372f224fc42c

Authored by 易文鹏
1 parent fc815df7

出库回传部分值用库存数据

src/main/java/com/huaheng/api/general/service/ShipmentApiService.java
... ... @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
5 5 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
6 6 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
7 7 import com.huaheng.api.general.domain.ShipmentDomain;
  8 +import com.huaheng.api.mes.dto.Rgv;
8 9 import com.huaheng.common.constant.HttpConstant;
9 10 import com.huaheng.common.constant.QuantityConstant;
10 11 import com.huaheng.common.exception.service.ServiceException;
... ... @@ -26,6 +27,8 @@ import com.huaheng.pc.config.station.service.StationService;
26 27 import com.huaheng.pc.config.warehouse.service.WarehouseService;
27 28 import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
28 29 import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService;
  30 +import com.huaheng.pc.inventory.inventoryTransaction.domain.InventoryTransaction;
  31 +import com.huaheng.pc.inventory.inventoryTransaction.service.InventoryTransactionService;
29 32 import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader;
30 33 import com.huaheng.pc.shipment.shipmentContainerHeader.service.ShipmentContainerHeaderService;
31 34 import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail;
... ... @@ -48,9 +51,7 @@ import org.springframework.transaction.annotation.Transactional;
48 51  
49 52 import javax.annotation.Resource;
50 53 import java.math.BigDecimal;
51   -import java.util.ArrayList;
52   -import java.util.Arrays;
53   -import java.util.List;
  54 +import java.util.*;
54 55 import java.util.stream.Collectors;
55 56  
56 57 /**
... ... @@ -107,6 +108,9 @@ public class ShipmentApiService {
107 108 @Resource
108 109 private TaskHeaderService taskHeaderService;
109 110  
  111 + @Resource
  112 + private InventoryTransactionService inventoryTransactionService;
  113 +
110 114 /**
111 115 * 出库单下发
112 116 *
... ... @@ -254,6 +258,25 @@ public class ShipmentApiService {
254 258 }
255 259 }
256 260  
  261 + //点位不等于空,调用MES的RGV接口
  262 + if (StringUtils.isNotEmpty(shipmentHeader.getLine())) {
  263 + String url = addressService.selectAddress(QuantityConstant.ADDRESS_MES_RGV);
  264 + Rgv rgv = new Rgv(port, shipmentHeader.getLine());
  265 + String jsonParam = JSON.toJSONString(rgv);
  266 + ResponseEntity<JSONObject> result1 = RestUtil.request_post(url, "CS0001", jsonParam, "调拨RGV出库,发送点位");
  267 + if (result1 != null && result1.getBody() != null) {
  268 + String code = result1.getBody().getString("RequestStatus");
  269 + String msg = result1.getBody().getString("Msg");
  270 + if (!HttpConstant.isMesSuccess(Integer.parseInt(code))) {
  271 + throw new ServiceException(msg);
  272 + }
  273 + } else {
  274 + throw new ServiceException("接口地址错误或返回为空");
  275 + }
  276 +
  277 + }
  278 +
  279 +
257 280 /* 6.step回传出库单和出库明细单 */
258 281 ShipmentDomain shipment = new ShipmentDomain();
259 282 shipment.setShipmentHeader(shipmentHeader);
... ... @@ -454,7 +477,31 @@ public class ShipmentApiService {
454 477 public AjaxResult shipmentBack(ShipmentHeader shipmentHeader) {
455 478 String warehouseCode = "CS0001";
456 479 String url = addressService.selectAddress(QuantityConstant.ADDRESS_MES_SHIPMENT);
457   - List<ShipmentDetail> shipmentDetailList = shipmentDetailService.list(new LambdaQueryWrapper<ShipmentDetail>().eq(ShipmentDetail::getShipmentId, shipmentHeader.getId()));
  480 + //List<ShipmentDetail> shipmentDetailList = shipmentDetailService.list(new LambdaQueryWrapper<ShipmentDetail>().eq(ShipmentDetail::getShipmentId, shipmentHeader.getId()));
  481 + List<InventoryTransaction> inventoryTransactionList = inventoryTransactionService.list(new LambdaQueryWrapper<InventoryTransaction>()
  482 + .eq(InventoryTransaction::getTransactionType, 20)
  483 + .eq(InventoryTransaction::getBillCode, shipmentHeader.getCode()));
  484 +
  485 + //处理库存交易
  486 + List<InventoryTransaction> inventoryTransactions = processInventoryTransactionList(inventoryTransactionList);
  487 + List<ShipmentDetail> shipmentDetailList = new ArrayList<>();
  488 + for (InventoryTransaction it : inventoryTransactions) {
  489 + ShipmentDetail sd = new ShipmentDetail();
  490 + sd.setId(it.getBillDetailId());
  491 + sd.setBatch(it.getBatch());
  492 + sd.setDoubleSided(it.getDoubleSided());
  493 + sd.setLabelCode(it.getLabelCode());
  494 + sd.setManage(it.getManage());
  495 + sd.setMaterialName(it.getMaterialName());
  496 + sd.setMaterialUnit(it.getMaterialUnit());
  497 + sd.setMaterialCode(it.getMaterialCode());
  498 + sd.setMaterialSpec(it.getMaterialSpec());
  499 + sd.setQty(it.getTaskQty());
  500 + sd.setShipmentCode(shipmentHeader.getCode());
  501 + sd.setShipmentId(shipmentHeader.getId());
  502 + shipmentDetailList.add(sd);
  503 + }
  504 + //替换出库明细部分值
458 505 ShipmentDomain shipmentDomain = new ShipmentDomain();
459 506 shipmentDomain.setShipmentHeader(shipmentHeader);
460 507 shipmentDomain.setShipmentDetails(shipmentDetailList);
... ... @@ -473,4 +520,29 @@ public class ShipmentApiService {
473 520 return AjaxResult.success();
474 521 }
475 522  
  523 + public List<InventoryTransaction> processInventoryTransactionList(List<InventoryTransaction> inventoryTransactionList) {
  524 + // 新建一个HashMap用于存储labelCode相同的库存交易对象
  525 + Map<String, InventoryTransaction> itMap = new HashMap<>();
  526 +
  527 + // 循环遍历 库存交易List
  528 + for (InventoryTransaction inventoryTransaction : inventoryTransactionList) {
  529 + // 如果taskQty为负数,则改为正数
  530 + if (inventoryTransaction.getTaskQty().compareTo(BigDecimal.ZERO) < 0) {
  531 + inventoryTransaction.setTaskQty(inventoryTransaction.getTaskQty().abs());
  532 + }
  533 +
  534 + // 如果itMap中已存在标签条码相同的,库存交易对象,则将taskQty相加
  535 + if (itMap.containsKey(inventoryTransaction.getLabelCode())) {
  536 + InventoryTransaction existingInventoryTransaction = itMap.get(inventoryTransaction.getLabelCode());
  537 + existingInventoryTransaction.setTaskQty(existingInventoryTransaction.getTaskQty().add(inventoryTransaction.getTaskQty()));
  538 + } else {
  539 + // 如果itMap中不存在该labelCode的库存交易对象,则将该对象存入map中
  540 + itMap.put(inventoryTransaction.getLabelCode(), inventoryTransaction);
  541 + }
  542 + }
  543 +
  544 + // 将map中的所有库存交易对象转为List并返回
  545 + return new ArrayList<>(itMap.values());
  546 + }
  547 +
476 548 }
... ...
src/main/java/com/huaheng/pc/inventory/inventoryTransaction/domain/InventoryTransaction.java
... ... @@ -312,4 +312,8 @@ public class InventoryTransaction implements Serializable {
312 312 @ApiModelProperty(value = "是否管控(1true/0false)")
313 313 private int manage;
314 314  
  315 + @TableField(value = "doubleSided")
  316 + @ApiModelProperty(value = "是否双面(1true/0false)")
  317 + private int doubleSided;
  318 +
315 319 }
... ...
src/main/java/com/huaheng/pc/shipment/shipmentContainerDetail/domain/ShipmentContainerDetail.java
... ... @@ -6,151 +6,152 @@ import com.baomidou.mybatisplus.annotation.TableId;
6 6 import com.baomidou.mybatisplus.annotation.TableName;
7 7 import io.swagger.annotations.ApiModel;
8 8 import io.swagger.annotations.ApiModelProperty;
  9 +
9 10 import java.io.Serializable;
10 11 import java.math.BigDecimal;
11 12 import java.util.Date;
12 13  
13   -@ApiModel(value="com.huaheng.pc.shipment.shipmentContainerDetail.domain.ShipmentContainerDetail")
  14 +@ApiModel(value = "com.huaheng.pc.shipment.shipmentContainerDetail.domain.ShipmentContainerDetail")
14 15 @TableName(value = "shipment_container_detail")
15 16 public class ShipmentContainerDetail implements Serializable {
16 17 /**
17 18 * 出库组盘明细号
18 19 */
19   - @TableId(value = "id", type = IdType.AUTO)
20   - @ApiModelProperty(value="出库组盘明细号")
  20 + @TableId(value = "id", type = IdType.AUTO)
  21 + @ApiModelProperty(value = "出库组盘明细号")
21 22 private Integer id;
22 23  
23 24 /**
24 25 * 出库组盘头号
25 26 */
26 27 @TableField(value = "shippingContainerId")
27   - @ApiModelProperty(value="出库组盘头号")
  28 + @ApiModelProperty(value = "出库组盘头号")
28 29 private Integer shippingContainerId;
29 30  
30 31 /**
31 32 * 出库箱号
32 33 */
33 34 @TableField(value = "containerCode")
34   - @ApiModelProperty(value="出库箱号")
  35 + @ApiModelProperty(value = "出库箱号")
35 36 private String containerCode;
36 37  
37 38 /**
38 39 * 库位
39 40 */
40 41 @TableField(value = "locationCode")
41   - @ApiModelProperty(value="库位")
  42 + @ApiModelProperty(value = "库位")
42 43 private String locationCode;
43 44  
44 45 /**
45 46 * 库存Id
46 47 */
47 48 @TableField(value = "inventoryId")
48   - @ApiModelProperty(value="库存Id")
  49 + @ApiModelProperty(value = "库存Id")
49 50 private Integer inventoryId;
50 51  
51 52 /**
52 53 * 出库单号
53 54 */
54 55 @TableField(value = "shipmentCode")
55   - @ApiModelProperty(value="出库单号")
  56 + @ApiModelProperty(value = "出库单号")
56 57 private String shipmentCode;
57 58  
58 59 /**
59 60 * 仓库
60 61 */
61 62 @TableField(value = "warehouseCode")
62   - @ApiModelProperty(value="仓库")
  63 + @ApiModelProperty(value = "仓库")
63 64 private String warehouseCode;
64 65  
65 66 /**
66 67 * 出库单内部号
67 68 */
68 69 @TableField(value = "shipmentId")
69   - @ApiModelProperty(value="出库单内部号")
  70 + @ApiModelProperty(value = "出库单内部号")
70 71 private Integer shipmentId;
71 72  
72 73 /**
73 74 * 出库单内部行号
74 75 */
75 76 @TableField(value = "shipmentDetailId")
76   - @ApiModelProperty(value="出库单内部行号")
  77 + @ApiModelProperty(value = "出库单内部行号")
77 78 private Integer shipmentDetailId;
78 79  
79 80 /**
80 81 * 货主
81 82 */
82 83 @TableField(value = "companyCode")
83   - @ApiModelProperty(value="货主")
  84 + @ApiModelProperty(value = "货主")
84 85 private String companyCode;
85 86  
86 87 /**
87 88 * 物料
88 89 */
89 90 @TableField(value = "materialCode")
90   - @ApiModelProperty(value="物料")
  91 + @ApiModelProperty(value = "物料")
91 92 private String materialCode;
92 93  
93 94 /**
94 95 * 物料名称
95 96 */
96 97 @TableField(value = "materialName")
97   - @ApiModelProperty(value="物料名称")
  98 + @ApiModelProperty(value = "物料名称")
98 99 private String materialName;
99 100  
100 101 /**
101 102 * 物料规格
102 103 */
103 104 @TableField(value = "materialSpec")
104   - @ApiModelProperty(value="物料规格")
  105 + @ApiModelProperty(value = "物料规格")
105 106 private String materialSpec;
106 107  
107 108 /**
108 109 * 物料单位
109 110 */
110 111 @TableField(value = "materialUnit")
111   - @ApiModelProperty(value="物料单位")
  112 + @ApiModelProperty(value = "物料单位")
112 113 private String materialUnit;
113 114  
114 115 /**
115 116 * 状态
116 117 */
117 118 @TableField(value = "status")
118   - @ApiModelProperty(value="状态")
  119 + @ApiModelProperty(value = "状态")
119 120 private Integer status;
120 121  
121 122 /**
122 123 * 重量
123 124 */
124 125 @TableField(value = "itemWeight")
125   - @ApiModelProperty(value="重量")
  126 + @ApiModelProperty(value = "重量")
126 127 private BigDecimal itemWeight;
127 128  
128 129 /**
129 130 * 体积
130 131 */
131 132 @TableField(value = "itemVolume")
132   - @ApiModelProperty(value="体积")
  133 + @ApiModelProperty(value = "体积")
133 134 private BigDecimal itemVolume;
134 135  
135 136 /**
136 137 * 长
137 138 */
138 139 @TableField(value = "itemLength")
139   - @ApiModelProperty(value="长")
  140 + @ApiModelProperty(value = "长")
140 141 private BigDecimal itemLength;
141 142  
142 143 /**
143 144 * 宽
144 145 */
145 146 @TableField(value = "itemWidth")
146   - @ApiModelProperty(value="宽")
  147 + @ApiModelProperty(value = "宽")
147 148 private BigDecimal itemWidth;
148 149  
149 150 /**
150 151 * 高
151 152 */
152 153 @TableField(value = "itemHeight")
153   - @ApiModelProperty(value="高")
  154 + @ApiModelProperty(value = "高")
154 155 private BigDecimal itemHeight;
155 156  
156 157  
... ... @@ -158,63 +159,63 @@ public class ShipmentContainerDetail implements Serializable {
158 159 * 数量
159 160 */
160 161 @TableField(value = "qty")
161   - @ApiModelProperty(value="数量")
  162 + @ApiModelProperty(value = "数量")
162 163 private BigDecimal qty;
163 164  
164 165 /**
165 166 * 波次号
166 167 */
167 168 @TableField(value = "waveId")
168   - @ApiModelProperty(value="波次号")
  169 + @ApiModelProperty(value = "波次号")
169 170 private Integer waveId;
170 171  
171 172 /**
172 173 * 任务已创建
173 174 */
174 175 @TableField(value = "taskCreated")
175   - @ApiModelProperty(value="任务已创建")
  176 + @ApiModelProperty(value = "任务已创建")
176 177 private Integer taskCreated;
177 178  
178 179 /**
179 180 * 属性号
180 181 */
181 182 @TableField(value = "attributeId")
182   - @ApiModelProperty(value="属性号")
  183 + @ApiModelProperty(value = "属性号")
183 184 private Integer attributeId;
184 185  
185 186 /**
186 187 * 属性1
187 188 */
188 189 @TableField(value = "attribute1")
189   - @ApiModelProperty(value="属性1")
  190 + @ApiModelProperty(value = "属性1")
190 191 private String attribute1;
191 192  
192 193 /**
193 194 * 属性2
194 195 */
195 196 @TableField(value = "attribute2")
196   - @ApiModelProperty(value="属性2")
  197 + @ApiModelProperty(value = "属性2")
197 198 private String attribute2;
198 199  
199 200 /**
200 201 * 属性3
201 202 */
202 203 @TableField(value = "attribute3")
203   - @ApiModelProperty(value="属性3")
  204 + @ApiModelProperty(value = "属性3")
204 205 private String attribute3;
205 206  
206 207 /**
207 208 * 属性4
208 209 */
209 210 @TableField(value = "attribute4")
210   - @ApiModelProperty(value="属性4")
  211 + @ApiModelProperty(value = "属性4")
211 212 private String attribute4;
212 213  
213 214 /**
214 215 * 任务类型
215 216 */
216 217 @TableField(value = "taskType")
217   - @ApiModelProperty(value="任务类型")
  218 + @ApiModelProperty(value = "任务类型")
218 219 private Integer taskType;
219 220  
220 221  
... ... @@ -222,63 +223,63 @@ public class ShipmentContainerDetail implements Serializable {
222 223 * 批次
223 224 */
224 225 @TableField(value = "batch")
225   - @ApiModelProperty(value="批次")
  226 + @ApiModelProperty(value = "批次")
226 227 private String batch;
227 228  
228 229 /**
229 230 * 批号
230 231 */
231 232 @TableField(value = "lot")
232   - @ApiModelProperty(value="批号")
  233 + @ApiModelProperty(value = "批号")
233 234 private String lot;
234 235  
235 236 /**
236 237 * 项目号
237 238 */
238 239 @TableField(value = "projectNo")
239   - @ApiModelProperty(value="项目号")
  240 + @ApiModelProperty(value = "项目号")
240 241 private String projectNo;
241 242  
242 243 /**
243 244 * 生产日期
244 245 */
245 246 @TableField(value = "manufactureDate")
246   - @ApiModelProperty(value="生产日期")
  247 + @ApiModelProperty(value = "生产日期")
247 248 private Date manufactureDate;
248 249  
249 250 /**
250 251 * 失效日期
251 252 */
252 253 @TableField(value = "expirationDate")
253   - @ApiModelProperty(value="失效日期")
  254 + @ApiModelProperty(value = "失效日期")
254 255 private Date expirationDate;
255 256  
256 257 /**
257 258 * 入库日期
258 259 */
259 260 @TableField(value = "agingDate")
260   - @ApiModelProperty(value="入库日期")
  261 + @ApiModelProperty(value = "入库日期")
261 262 private Date agingDate;
262 263  
263 264 /**
264 265 * 库存状态
265 266 */
266 267 @TableField(value = "inventorySts")
267   - @ApiModelProperty(value="库存状态")
  268 + @ApiModelProperty(value = "库存状态")
268 269 private String inventorySts;
269 270  
270 271 /**
271 272 * 包装分类
272 273 */
273 274 @TableField(value = "packingClass")
274   - @ApiModelProperty(value="包装分类")
  275 + @ApiModelProperty(value = "包装分类")
275 276 private String packingClass;
276 277  
277 278 /**
278 279 * 周转箱号
279 280 */
280 281 @TableField(value = "transContainerCode")
281   - @ApiModelProperty(value="周转箱号")
  282 + @ApiModelProperty(value = "周转箱号")
282 283 private String transContainerCode;
283 284  
284 285  
... ... @@ -286,72 +287,109 @@ public class ShipmentContainerDetail implements Serializable {
286 287 * 创建时间
287 288 */
288 289 @TableField(value = "created")
289   - @ApiModelProperty(value="创建时间")
  290 + @ApiModelProperty(value = "创建时间")
290 291 private Date created;
291 292  
292 293 /**
293 294 * 创建用户
294 295 */
295 296 @TableField(value = "createdBy")
296   - @ApiModelProperty(value="创建用户")
  297 + @ApiModelProperty(value = "创建用户")
297 298 private String createdBy;
298 299  
299 300 /**
300 301 * 创建时间
301 302 */
302 303 @TableField(value = "lastUpdated")
303   - @ApiModelProperty(value="创建时间")
  304 + @ApiModelProperty(value = "创建时间")
304 305 private Date lastUpdated;
305 306  
306 307 /**
307 308 * 更新用户
308 309 */
309 310 @TableField(value = "lastUpdatedBy")
310   - @ApiModelProperty(value="更新用户")
  311 + @ApiModelProperty(value = "更新用户")
311 312 private String lastUpdatedBy;
312 313  
313 314 /**
314 315 * 数据版本
315 316 */
316 317 @TableField(value = "version")
317   - @ApiModelProperty(value="数据版本")
  318 + @ApiModelProperty(value = "数据版本")
318 319 private Integer version;
319 320  
320 321 /**
321 322 * 自定义字段1
322 323 */
323 324 @TableField(value = "userDef1")
324   - @ApiModelProperty(value="自定义字段1")
  325 + @ApiModelProperty(value = "自定义字段1")
325 326 private String userDef1;
326 327  
327 328 /**
328 329 * 自定义字段2
329 330 */
330 331 @TableField(value = "userDef2")
331   - @ApiModelProperty(value="自定义字段2")
  332 + @ApiModelProperty(value = "自定义字段2")
332 333 private String userDef2;
333 334  
334 335 /**
335 336 * 自定义字段3
336 337 */
337 338 @TableField(value = "userDef3")
338   - @ApiModelProperty(value="自定义字段3")
  339 + @ApiModelProperty(value = "自定义字段3")
339 340 private String userDef3;
340 341  
341 342 /**
342 343 * 处理标记
343 344 */
344 345 @TableField(value = "processStamp")
345   - @ApiModelProperty(value="处理标记")
  346 + @ApiModelProperty(value = "处理标记")
346 347 private String processStamp;
347 348  
  349 +
  350 + public String getLabelCode() {
  351 + return labelCode;
  352 + }
  353 +
  354 + public void setLabelCode(String labelCode) {
  355 + this.labelCode = labelCode;
  356 + }
  357 +
  358 + public int getManage() {
  359 + return manage;
  360 + }
  361 +
  362 + public void setManage(int manage) {
  363 + this.manage = manage;
  364 + }
  365 +
  366 + public int getDoubleSided() {
  367 + return doubleSided;
  368 + }
  369 +
  370 + public void setDoubleSided(int doubleSided) {
  371 + this.doubleSided = doubleSided;
  372 + }
  373 +
  374 + @TableField(value = "labelCode")
  375 + @ApiModelProperty(value = "标签条码")
  376 + private String labelCode;
  377 +
  378 + @TableField(value = "manage")
  379 + @ApiModelProperty(value = "是否管控(1true/0false)")
  380 + private int manage;
  381 +
  382 + @TableField(value = "doubleSided")
  383 + @ApiModelProperty(value = "是否双面(1true/0false)")
  384 + private int doubleSided;
  385 +
348 386 private static final long serialVersionUID = 1L;
349 387  
350 388 public static final String COL_CONTAINERCODE = "containerCode";
351 389  
352 390 public static final String COL_LOCATIONCODE = "locationCode";
353 391  
354   - public static final String COL_INVENTORYID= "inventoryId";
  392 + public static final String COL_INVENTORYID = "inventoryId";
355 393  
356 394 public static final String COL_SHIPPINGCONTAINERID = "shippingContainerId";
357 395  
... ... @@ -373,7 +411,7 @@ public class ShipmentContainerDetail implements Serializable {
373 411  
374 412 public static final String COL_MATERIALUNIT = "materialUnit";
375 413  
376   - public static final String COL_STATUS= "status";
  414 + public static final String COL_STATUS = "status";
377 415  
378 416 public static final String COL_ITEMWEIGHT = "itemWeight";
379 417  
... ...
src/main/java/com/huaheng/pc/shipment/shipmentContainerHeader/service/ShipmentContainerHeaderServiceImpl.java
... ... @@ -2,6 +2,7 @@ package com.huaheng.pc.shipment.shipmentContainerHeader.service;
2 2  
3 3 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
4 4 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  5 +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
5 6 import com.huaheng.common.constant.QuantityConstant;
6 7 import com.huaheng.common.exception.service.ServiceException;
7 8 import com.huaheng.common.utils.StringUtils;
... ... @@ -17,13 +18,14 @@ import com.huaheng.pc.config.material.service.MaterialService;
17 18 import com.huaheng.pc.config.shipmentPreference.service.ShipmentPreferenceService;
18 19 import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
19 20 import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService;
20   -import com.huaheng.pc.inventory.inventoryHeader.domain.InventoryHeader;
21 21 import com.huaheng.pc.inventory.inventoryHeader.service.InventoryHeaderService;
22 22 import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader;
23 23 import com.huaheng.pc.receipt.receiptContainerHeader.service.ReceiptContainerHeaderService;
24 24 import com.huaheng.pc.shipment.shipmentContainerDetail.domain.ShipmentContainerDetail;
25 25 import com.huaheng.pc.shipment.shipmentContainerDetail.service.ShipmentContainerDetailService;
26 26 import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentCombinationModel;
  27 +import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader;
  28 +import com.huaheng.pc.shipment.shipmentContainerHeader.mapper.ShipmentContainerHeaderMapper;
27 29 import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail;
28 30 import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService;
29 31 import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader;
... ... @@ -39,17 +41,16 @@ import com.huaheng.pc.task.taskHeader.service.ShipmentTaskService;
39 41 import com.huaheng.pc.task.taskHeader.service.TaskHeaderService;
40 42 import org.springframework.beans.factory.annotation.Autowired;
41 43 import org.springframework.stereotype.Service;
  44 +import org.springframework.transaction.annotation.Transactional;
42 45  
43 46 import javax.annotation.Resource;
44 47 import java.math.BigDecimal;
45   -import java.util.*;
  48 +import java.util.ArrayList;
  49 +import java.util.Arrays;
  50 +import java.util.List;
  51 +import java.util.Map;
46 52 import java.util.stream.Collectors;
47 53  
48   -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
49   -import com.huaheng.pc.shipment.shipmentContainerHeader.domain.ShipmentContainerHeader;
50   -import com.huaheng.pc.shipment.shipmentContainerHeader.mapper.ShipmentContainerHeaderMapper;
51   -import org.springframework.transaction.annotation.Transactional;
52   -
53 54 @Service
54 55 public class ShipmentContainerHeaderServiceImpl extends ServiceImpl<ShipmentContainerHeaderMapper, ShipmentContainerHeader> implements ShipmentContainerHeaderService {
55 56  
... ... @@ -319,6 +320,10 @@ public class ShipmentContainerHeaderServiceImpl extends ServiceImpl&lt;ShipmentCont
319 320 shipmentContainerDetaill.setLot(shipmentDetail.getLot());
320 321 shipmentContainerDetaill.setProjectNo(shipmentDetail.getProjectNo());
321 322 shipmentContainerDetaill.setCreatedBy(ShiroUtils.getName());
  323 +
  324 + shipmentContainerDetaill.setLabelCode(shipmentDetail.getLabelCode());
  325 + shipmentContainerDetaill.setDoubleSided(shipmentDetail.getDoubleSided());
  326 + shipmentContainerDetaill.setManage(shipmentDetail.getManage());
322 327 flag = shipmentContainerDetailService.save(shipmentContainerDetaill);
323 328 if (flag == false) {
324 329 throw new ServiceException("新建组盘明细失败,sql错误");
... ...
src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java
... ... @@ -9,11 +9,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
9 9 import com.huaheng.api.general.service.ShipmentApiService;
10 10 import com.huaheng.api.mes.controller.MesReceiptController;
11 11 import com.huaheng.api.mes.result.ReturnInfo;
12   -import com.huaheng.common.constant.HttpConstant;
13 12 import com.huaheng.common.constant.QuantityConstant;
14 13 import com.huaheng.common.exception.service.ServiceException;
15 14 import com.huaheng.common.support.Convert;
16   -import com.huaheng.common.utils.DateUtils;
17 15 import com.huaheng.common.utils.StringUtils;
18 16 import com.huaheng.common.utils.security.ShiroUtils;
19 17 import com.huaheng.framework.aspectj.lang.annotation.Log;
... ... @@ -28,7 +26,6 @@ import com.huaheng.pc.config.waveMaster.service.WaveMasterService;
28 26 import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail;
29 27 import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService;
30 28 import com.huaheng.pc.momLog.service.IMomLogService;
31   -import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader;
32 29 import com.huaheng.pc.shipment.shipmentContainerDetail.domain.ShipmentContainerDetail;
33 30 import com.huaheng.pc.shipment.shipmentContainerDetail.service.ShipmentContainerDetailService;
34 31 import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail;
... ... @@ -39,7 +36,6 @@ import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService;
39 36 import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderServiceImpl;
40 37 import com.huaheng.pc.shipment.shipmentHeaderHistory.service.ShipmentHeaderHistoryService;
41 38 import com.huaheng.pc.task.taskHeader.service.ShipmentTaskService;
42   -import io.jsonwebtoken.lang.Assert;
43 39 import org.apache.shiro.authz.annotation.RequiresPermissions;
44 40 import org.springframework.stereotype.Controller;
45 41 import org.springframework.transaction.annotation.Transactional;
... ... @@ -49,7 +45,6 @@ import org.springframework.web.bind.annotation.*;
49 45 import javax.annotation.Resource;
50 46 import java.lang.reflect.InvocationTargetException;
51 47 import java.math.BigDecimal;
52   -import java.text.SimpleDateFormat;
53 48 import java.util.ArrayList;
54 49 import java.util.Arrays;
55 50 import java.util.Date;
... ... @@ -121,6 +116,7 @@ public class ShipmentHeaderController extends BaseController {
121 116 .like(StringUtils.isNotEmpty(shipmentHeader.getShipmentNote()), ShipmentHeader::getShipmentNote, shipmentHeader.getShipmentNote())
122 117 .like(StringUtils.isNotEmpty(shipmentHeader.getProcessType()), ShipmentHeader::getProcessType, shipmentHeader.getProcessType())
123 118 .eq(StringUtils.isNotEmpty(shipmentHeader.getShipmentType()), ShipmentHeader::getShipmentType, shipmentHeader.getShipmentType())
  119 + .eq(StringUtils.isNotEmpty(shipmentHeader.getCode()), ShipmentHeader::getCode, shipmentHeader.getCode())
124 120 .eq(StringUtils.isNotEmpty(shipmentHeader.getReferCode()), ShipmentHeader::getReferCode, shipmentHeader.getReferCode())
125 121 .like(StringUtils.isNotEmpty(shipmentHeader.getTransferWarehouseName()), ShipmentHeader::getTransferWarehouseName, shipmentHeader.getTransferWarehouseName())
126 122 .eq(StringUtils.isNotEmpty(shipmentHeader.getReferCodeType()), ShipmentHeader::getReferCodeType, shipmentHeader.getReferCodeType())
... ...
src/main/java/com/huaheng/pc/task/taskDetail/domain/TaskDetail.java
... ... @@ -3,13 +3,12 @@ package com.huaheng.pc.task.taskDetail.domain;
3 3 import com.baomidou.mybatisplus.annotation.*;
4 4 import io.swagger.annotations.ApiModel;
5 5 import io.swagger.annotations.ApiModelProperty;
  6 +import lombok.Data;
6 7  
7 8 import java.io.Serializable;
8 9 import java.math.BigDecimal;
9 10 import java.util.Date;
10 11  
11   -import lombok.Data;
12   -
13 12 @ApiModel(value = "com.huaheng.pc.task.taskDetail.domain.TaskDetail")
14 13 @Data
15 14 @TableName(value = "task_detail")
... ... @@ -381,6 +380,18 @@ public class TaskDetail implements Serializable {
381 380 @ApiModelProperty(value = "是否是新增的单据")
382 381 private String isNew;
383 382  
  383 + @TableField(value = "labelCode")
  384 + @ApiModelProperty(value = "标签条码")
  385 + private String labelCode;
  386 +
  387 + @TableField(value = "manage")
  388 + @ApiModelProperty(value = "是否管控(1true/0false)")
  389 + private int manage;
  390 +
  391 + @TableField(value = "doubleSided")
  392 + @ApiModelProperty(value = "是否双面(1true/0false)")
  393 + private int doubleSided;
  394 +
384 395 private static final long serialVersionUID = 1L;
385 396  
386 397 }
... ...
src/main/java/com/huaheng/pc/task/taskHeader/service/ShipmentTaskService.java
... ... @@ -245,6 +245,10 @@ public class ShipmentTaskService {
245 245 taskDetail.setStatus(QuantityConstant.TASK_STATUS_BUILD);
246 246 taskDetail.setWaveId(shipmentContainerDetail.getWaveId());
247 247 taskDetail.setInventorySts(shipmentContainerDetail.getInventorySts());
  248 +
  249 + taskDetail.setDoubleSided(shipmentContainerDetail.getDoubleSided());
  250 + taskDetail.setLabelCode(shipmentContainerDetail.getLabelCode());
  251 + taskDetail.setManage(shipmentContainerDetail.getManage());
248 252 if (!taskDetailService.save(taskDetail)) {
249 253 throw new ServiceException("新建任务明细失败,sql报错");
250 254 }
... ... @@ -392,6 +396,7 @@ public class ShipmentTaskService {
392 396 if (shipmentDetail != null) {
393 397 inventoryTransaction.setBillDetailId(shipmentDetail.getId());
394 398 inventoryTransaction.setNoticeNo(shipmentDetail.getNoticeNo());
  399 + inventoryTransaction.setDoubleSided(shipmentDetail.getDoubleSided());
395 400 }
396 401 inventoryTransaction.setBatch(inventoryDetail.getBatch());
397 402 inventoryTransaction.setLot(inventoryDetail.getLot());
... ... @@ -549,6 +554,11 @@ public class ShipmentTaskService {
549 554 taskDetail.setBatch(inventoryDetail.getBatch());
550 555 taskDetail.setStatus(QuantityConstant.TASK_STATUS_BUILD);
551 556 taskDetail.setInventorySts(inventoryDetail.getInventorySts());
  557 +
  558 + taskDetail.setManage(inventoryDetail.getManage());
  559 + taskDetail.setLabelCode(inventoryDetail.getLabelCode());
  560 + //taskDetail.setDoubleSided(ShipmentDetail.getDoubleSided());
  561 +
552 562 taskDetail.setIsNew("系统新增任务");
553 563 if (!taskDetailService.save(taskDetail)) {
554 564 throw new ServiceException("新建任务明细失败,sql报错");
... ... @@ -688,6 +698,10 @@ public class ShipmentTaskService {
688 698 shipmentContainerDetaill.setLot(shipmentDetail.getLot());
689 699 shipmentContainerDetaill.setProjectNo(shipmentDetail.getProjectNo());
690 700 shipmentContainerDetaill.setCreatedBy(ShiroUtils.getName());
  701 +
  702 + shipmentContainerDetaill.setLabelCode(shipmentDetail.getLabelCode());
  703 + shipmentContainerDetaill.setDoubleSided(shipmentDetail.getDoubleSided());
  704 + shipmentContainerDetaill.setManage(shipmentDetail.getManage());
691 705 flag = shipmentContainerDetailService.save(shipmentContainerDetaill);
692 706 if (!flag) {
693 707 throw new ServiceException("新建组盘明细失败,sql错误");
... ...
src/main/resources/templates/inventory/inventoryTransaction/inventoryTransaction.html
... ... @@ -210,6 +210,38 @@
210 210 visible: true
211 211 },
212 212 {
  213 + field: 'doubleSided',
  214 + title: '是否双面',
  215 + align: "center",
  216 + formatter: function (value, row, index) {
  217 + var actions = [];
  218 + if (value === 0) {
  219 + actions.push("<span class='badge badge-info'>否</span>");
  220 + } else {
  221 + actions.push("<span class='badge badge-info'>是</span>");
  222 + }
  223 + return actions.join('');
  224 + },
  225 + },
  226 + {
  227 + field: 'manage',
  228 + title: '是否管控',
  229 + align: "center",
  230 + formatter: function (value, row, index) {
  231 + var actions = [];
  232 + if (value === 0) {
  233 + actions.push("<span class='badge badge-info'>否</span>");
  234 + } else {
  235 + actions.push("<span class='badge badge-info'>是</span>");
  236 + }
  237 + return actions.join('');
  238 + },
  239 + },
  240 + {
  241 + field: 'labelCode',
  242 + title: '标签条码'
  243 + },
  244 + {
213 245 field: 'lot',
214 246 title: '批号',
215 247 visible: false
... ...
src/main/resources/templates/shipment/shippingCombination/shippingCombination.html
... ... @@ -366,6 +366,10 @@
366 366 field: 'qty',
367 367 title: '数量'
368 368 },
  369 + // {
  370 + // field: "labelCode",
  371 + // title: "标签条码"
  372 + // },
369 373 {
370 374 field: "materialSpec",
371 375 title: "物料规格"
... ...
src/main/resources/templates/task/taskHeader/taskHeader.html
... ... @@ -417,6 +417,38 @@
417 417 title: '批次',
418 418 },
419 419 {
  420 + field: 'doubleSided',
  421 + title: '是否双面',
  422 + align: "center",
  423 + formatter: function (value, row, index) {
  424 + var actions = [];
  425 + if (value === 0) {
  426 + actions.push("<span class='badge badge-info'>否</span>");
  427 + } else {
  428 + actions.push("<span class='badge badge-info'>是</span>");
  429 + }
  430 + return actions.join('');
  431 + },
  432 + },
  433 + {
  434 + field: 'manage',
  435 + title: '是否管控',
  436 + align: "center",
  437 + formatter: function (value, row, index) {
  438 + var actions = [];
  439 + if (value === 0) {
  440 + actions.push("<span class='badge badge-info'>否</span>");
  441 + } else {
  442 + actions.push("<span class='badge badge-info'>是</span>");
  443 + }
  444 + return actions.join('');
  445 + },
  446 + },
  447 + {
  448 + field: 'labelCode',
  449 + title: '标签条码'
  450 + },
  451 + {
420 452 field: 'projectNo',
421 453 title: '项目号',
422 454 visible: false,
... ...