Commit 864b71dbbfcc7c1ef5f3a4d5b37b434bc8910f45

Authored by hh
1 parent a9957295

海王_提供给MOM接口更改

src/main/java/com/huaheng/api/mes/controller/MesReceiptController.java
... ... @@ -87,6 +87,9 @@ public class MesReceiptController extends BaseController {
87 87 // receiptHeader.setReceiptType("CS");
88 88 receiptHeader.setTotalQty(header.getTotalQty());
89 89 receiptHeader.setTotalLines(details.size());
  90 + // TAID MOM目标类型 // FAID MOM来源类型
  91 + receiptHeader.setTAID(header.getTAID());
  92 + receiptHeader.setFAID(header.getFAID());
90 93 receiptHeader.setFirstStatus(QuantityConstant.RECEIPT_HEADER_BUILD);
91 94 receiptHeader.setLastStatus(QuantityConstant.RECEIPT_HEADER_BUILD);
92 95 receiptHeader.setWarehouseCode("CS0001");
... ... @@ -101,6 +104,9 @@ public class MesReceiptController extends BaseController {
101 104 receiptDetail.setMaterialCode(detail.getMaterialCode());
102 105 receiptDetail.setMaterialName(detail.getMaterialName());
103 106 receiptDetail.setQty(detail.getQty());
  107 + receiptDetail.setIsUrgent(detail.getIsUrgent());
  108 + receiptDetail.setNoticeNo(detail.getNoticeNo());
  109 + receiptDetail.setSNNO(detail.getSNNO());
104 110 receiptDetail.setReceiptId(receiptHeader.getId());
105 111 receiptDetail.setReceiptCode(receiptHeader.getCode());
106 112 receiptDetail.setWarehouseCode("CS0001");
... ... @@ -109,10 +115,8 @@ public class MesReceiptController extends BaseController {
109 115 shipemtnDetailList.add(receiptDetail);
110 116 });
111 117 receiptDetailService.saveBatch(shipemtnDetailList);
112   - // 入库应答
113   - JSONObject data = getJsonObject(header, details);
114   - postE_Rd_In_Res(data.toString());
115   - return ajaxResult.setCode(RetCode.SUCCESS).setMsg("成功");
  118 +
  119 + return AjaxResult.success(receiptDTO); //ajaxResult.setCode(RetCode.SUCCESS).setMsg("成功");
116 120 }
117 121  
118 122  
... ... @@ -138,6 +142,9 @@ public class MesReceiptController extends BaseController {
138 142 shipmentHeader.setCode(header.getReferCode());
139 143 shipmentHeader.setShipmentType(header.getRefeCodeType());
140 144 shipmentHeader.setTotalQty(header.getTotalQty());
  145 + // TAID MOM目标类型 // FAID MOM来源类型
  146 + shipmentHeader.setTAID(header.getTAID());
  147 + shipmentHeader.setFAID(header.getFAID());
141 148 shipmentHeader.setFirstStatus(QuantityConstant.SHIPMENT_CONTAINER_BUILD);
142 149 shipmentHeader.setLastStatus(QuantityConstant.SHIPMENT_CONTAINER_BUILD);
143 150 shipmentHeader.setWarehouseCode("CS0001");
... ... @@ -152,6 +159,10 @@ public class MesReceiptController extends BaseController {
152 159 shipmentDetail.setMaterialName(detail.getMaterialName());
153 160 shipmentDetail.setPort(detail.getEndSation());
154 161 shipmentDetail.setQty(detail.getQty());
  162 + shipmentDetail.setIsUrgent(detail.getIsUrgent());
  163 + shipmentDetail.setNoticeNo(detail.getNoticeNo());
  164 + shipmentDetail.setSNNO(detail.getSNNO());
  165 +
155 166 shipmentDetail.setShipmentId(shipmentHeader.getId());
156 167 shipmentDetail.setShipmentCode(shipmentHeader.getCode());
157 168 shipmentDetail.setCompanyCode("BHF");
... ... @@ -161,10 +172,8 @@ public class MesReceiptController extends BaseController {
161 172 shipmentDetailList.add(shipmentDetail);
162 173 });
163 174 shipmentDetailService.saveBatch(shipmentDetailList);
164   - // 入库应答
165   - JSONObject data = getJsonObject(header, details);
166   - postE_Rd_Out_Res(data.toString());
167   - return ajaxResult.setCode(RetCode.SUCCESS).setMsg("成功");
  175 +
  176 + return AjaxResult.success(receiptDTO);
168 177 }
169 178  
170 179 private JSONObject getJsonObject(Header header, List<Detail> details) {
... ... @@ -265,13 +274,13 @@ public class MesReceiptController extends BaseController {
265 274 AjaxResult ajaxResult = isNull(header, details);
266 275 if (StringUtils.isNotEmpty(ajaxResult.getMsg())) return ajaxResult;
267 276  
268   - // 查询库单据表头
  277 + // 查询库单据表头
269 278 LambdaQueryWrapper<ReceiptHeader> receiptHeaderWrapper = Wrappers.lambdaQuery();
270 279 receiptHeaderWrapper.eq(ReceiptHeader::getId, header.getId());
271 280 ReceiptHeader receiptHeader = receiptHeaderService.getById(receiptHeaderWrapper);
272 281 if (receiptHeader == null)
273 282 return ajaxResult.setCode(RetCode.FAIL).setMsg("没有找到对应单据!!!");
274   - // 查询库单据明细
  283 + // 查询库单据明细
275 284 LambdaQueryWrapper<ReceiptDetail> receiptDetailWrapper = Wrappers.lambdaQuery();
276 285 receiptDetailWrapper.eq(ReceiptDetail::getReceiptId, receiptHeader.getId());
277 286 List<ReceiptDetail> receiptDetailList = receiptDetailService.list(receiptDetailWrapper);
... ... @@ -535,22 +544,41 @@ public class MesReceiptController extends BaseController {
535 544 @ApiLogger(apiName = "post调用E_Rd_In(MOM)入库接口", from="ROBOT")
536 545 @PostMapping("/postE_Rd_In")
537 546 public JSONObject postE_Rd_In(){
538   - String action = "E_Rd_In";
539   - JSONObject json = new JSONObject();
540   - json.put("data", "");
541 547  
542   - return postMOM(action, json);
543   - }
  548 + // 查询入库单据表头
  549 + ReceiptHeader receiptHeader = receiptHeaderService.getById(53); //59
  550 + JSONObject Rd_In_M = new JSONObject();
  551 + Rd_In_M.put("mno", receiptHeader.getReferCode());
  552 + Rd_In_M.put("MGPK", receiptHeader.getReferId());
  553 + Rd_In_M.put("cBusType", receiptHeader.getReceiptType());
  554 + Rd_In_M.put("TAID", receiptHeader.getTAID());
  555 + Rd_In_M.put("FAID", receiptHeader.getFAID());
544 556  
545   - /**
546   - * post调用E_Rd_In_Res(MOM)入库接口应答
547   - */
548   - @ApiLogger(apiName = "post调用E_Rd_In_Res(MOM)入库接口应答", from="ROBOT")
549   - @PostMapping("/postE_Rd_In_Res")
550   - public JSONObject postE_Rd_In_Res(String data){
551   - String action = "E_Rd_In_Res";
  557 + // 查询入库单据明细
  558 + LambdaQueryWrapper<ReceiptDetail> receiptDetailWrapper = Wrappers.lambdaQuery();
  559 + receiptDetailWrapper.eq(ReceiptDetail::getReceiptId, receiptHeader.getId());
  560 + List<ReceiptDetail> receiptDetailList = receiptDetailService.list(receiptDetailWrapper);
  561 + JSONArray jsonArray = new JSONArray();
  562 + receiptDetailList.forEach(receiptDetail->{
  563 + JSONObject Rd_In_S = new JSONObject();
  564 + Rd_In_S.put("MGPK", receiptHeader.getReferId());
  565 + Rd_In_S.put("SGPK", receiptDetail.getReferId());
  566 + Rd_In_S.put("SNNO", receiptDetail.getSNNO());
  567 + Rd_In_S.put("cInvCode", receiptDetail.getMaterialCode());
  568 + Rd_In_S.put("Iquantity", receiptDetail.getTaskQty());
  569 + Rd_In_S.put("iFQuantity", receiptDetail.getQty());
  570 + Rd_In_S.put("cwhcode", receiptDetail.getWarehouseCode());
  571 + Rd_In_S.put("MOCode", receiptDetail.getNoticeNo());
  572 + Rd_In_S.put("ISUrgent", receiptDetail.getIsUrgent());
  573 + jsonArray.add(Rd_In_S);
  574 + });
  575 + JSONObject data = new JSONObject();
  576 + data.put("Rd_In_M", Rd_In_M);
  577 + data.put("Rd_In_S", jsonArray);
  578 +
  579 + String action = "E_Rd_In";
552 580 JSONObject json = new JSONObject();
553   - json.put("data", "");
  581 + json.put("data", data);
554 582  
555 583 return postMOM(action, json);
556 584 }
... ... @@ -561,27 +589,45 @@ public class MesReceiptController extends BaseController {
561 589 @ApiLogger(apiName = "post调用E_Rd_Out(MOM)出库接口", from="ROBOT")
562 590 @PostMapping("/postE_Rd_Out")
563 591 public JSONObject postE_Rd_Out(){
564   - String action = "E_Rd_Out";
565   - JSONObject json = new JSONObject();
566   - json.put("data", "");
  592 + // 查询出库单据表头
  593 + ShipmentHeader shipmentHeader = shipmentHeaderService.getById("28");
  594 + JSONObject Rd_Out_M = new JSONObject();
  595 + Rd_Out_M.put("mno", shipmentHeader.getReferCode());
  596 + Rd_Out_M.put("MGPK", shipmentHeader.getReferId());
  597 + Rd_Out_M.put("cBusType", shipmentHeader.getShipmentType());
  598 + Rd_Out_M.put("TAID", shipmentHeader.getTAID());
  599 + Rd_Out_M.put("FAID", shipmentHeader.getFAID());
567 600  
568   - return postMOM(action, json);
569   - }
  601 + // 查询出库单据明细
  602 + LambdaQueryWrapper<ShipmentDetail> shipmentDetailWrapper = Wrappers.lambdaQuery();
  603 + shipmentDetailWrapper.eq(ShipmentDetail::getShipmentId, shipmentHeader.getId());
  604 + List<ShipmentDetail> shipmentDetailList = shipmentDetailService.list(shipmentDetailWrapper);
  605 + JSONArray jsonArray = new JSONArray();
  606 + shipmentDetailList.forEach( shipmentDetail->{
  607 + JSONObject Rd_Out_S = new JSONObject();
  608 + Rd_Out_S.put("MGPK", shipmentHeader.getReferId());
  609 + Rd_Out_S.put("SGPK", shipmentDetail.getReferId());
  610 + Rd_Out_S.put("SNNO", shipmentDetail.getSNNO());
  611 + Rd_Out_S.put("cInvCode", shipmentDetail.getMaterialCode());
  612 + Rd_Out_S.put("Iquantity", shipmentDetail.getTaskQty());
  613 + Rd_Out_S.put("iFQuantity", shipmentDetail.getQty());
  614 + Rd_Out_S.put("cwhcode", shipmentDetail.getWarehouseCode());
  615 + Rd_Out_S.put("MOCode", shipmentDetail.getNoticeNo());
  616 + Rd_Out_S.put("ISUrgent", shipmentDetail.getIsUrgent());
  617 + jsonArray.add(Rd_Out_S);
  618 + });
  619 + JSONObject data = new JSONObject();
  620 + data.put("Rd_Out_M", Rd_Out_M);
  621 + data.put("Rd_Out_S", jsonArray);
570 622  
571   - /**
572   - * post调用E_Rd_In_Res(MOM)出库接口应答
573   - */
574   - @ApiLogger(apiName = "post调用E_Rd_In_Res(MOM)出库接口应答", from="ROBOT")
575   - @PostMapping("/postE_Rd_Out_Res")
576   - public JSONObject postE_Rd_Out_Res(String data){
577   - String action = "postE_Rd_Out_Res";
  623 +
  624 + String action = "E_Rd_Out";
578 625 JSONObject json = new JSONObject();
579 626 json.put("data", data);
580 627  
581 628 return postMOM(action, json);
582 629 }
583 630  
584   -
585 631 /**
586 632 * @param action MOM行为
587 633 * @param JObject 行为参数
... ... @@ -589,7 +635,7 @@ public class MesReceiptController extends BaseController {
589 635 */
590 636 public JSONObject postMOM(String action, JSONObject JObject){
591 637 String url = "http://192.168.101.127:31055//Handler/H_DJ2J_10.ashx";
592   - String param = "sptype=JSP_W2M&action=" + action + "&onlydata=1&params=" + JObject.toString();
  638 + String param = "sptype=JSP_W2M&action=" + action + "&onlydata=1&params=" + JObject;
593 639 CallaMOM callMOM = new CallaMOM();
594 640 String data = callMOM.sendPost(url, param);
595 641 JSONObject ret = JSONObject.parseObject(data);
... ...
src/main/java/com/huaheng/api/mes/dto/Detail.java
... ... @@ -55,6 +55,35 @@ public class Detail {
55 55 @ApiModelProperty(value="条码")
56 56 private String SNNO;
57 57  
  58 + /**
  59 + * 是否紧急
  60 + */
  61 + @ApiModelProperty(value="是否紧急")
  62 + private boolean isUrgent;
  63 +
  64 + /**
  65 + * 通知单号
  66 + */
  67 + @ApiModelProperty(value="通知单号")
  68 + private String noticeNo;
  69 +
  70 +
  71 + public boolean getIsUrgent() {
  72 + return isUrgent;
  73 + }
  74 +
  75 + public void setUrgent(boolean urgent) {
  76 + isUrgent = urgent;
  77 + }
  78 +
  79 + public String getNoticeNo() {
  80 + return noticeNo;
  81 + }
  82 +
  83 + public void setNoticeNo(String noticeNo) {
  84 + this.noticeNo = noticeNo;
  85 + }
  86 +
58 87 public BigDecimal getQty() {
59 88 return qty;
60 89 }
... ...
src/main/java/com/huaheng/api/mes/dto/Header.java
1 1 package com.huaheng.api.mes.dto;
2 2  
  3 +import com.baomidou.mybatisplus.annotation.TableField;
3 4 import io.swagger.annotations.ApiModelProperty;
4 5  
5 6 import java.math.BigDecimal;
... ... @@ -9,17 +10,49 @@ public class Header {
9 10 @ApiModelProperty(value="id")
10 11 private Integer id;
11 12  
12   - /** 入库单 单号*/
  13 + /**
  14 + * 入库单 单号
  15 + */
13 16 @ApiModelProperty(value="MES单据单号")
14 17 private String referCode;
15 18  
16   - /**入库单 单据类型 (用于区分入库和外协入库)*/
  19 + /**
  20 + * 入库单 单据类型 (用于区分入库和外协入库)
  21 + */
17 22 @ApiModelProperty(value="MES单据类型")
18 23 private String refeCodeType;
19 24  
20 25 @ApiModelProperty(value="总数量")
21 26 private BigDecimal totalQty;
22 27  
  28 + /**
  29 + * MOM目标类型
  30 + */
  31 + @ApiModelProperty(value="MOM目标类型")
  32 + private String TAID;
  33 +
  34 + /**
  35 + * MOM来源类型
  36 + */
  37 + @ApiModelProperty(value="MOM来源类型")
  38 + private String FAID;
  39 +
  40 + public String getTAID() {
  41 + return TAID;
  42 + }
  43 +
  44 + public void setTAID(String TAID) {
  45 + this.TAID = TAID;
  46 + }
  47 +
  48 + public String getFAID() {
  49 + return FAID;
  50 + }
  51 +
  52 + public void setFAID(String FAID) {
  53 + this.FAID = FAID;
  54 + }
  55 +
23 56 public BigDecimal getTotalQty() {
24 57 return totalQty;
25 58 }
... ...
src/main/java/com/huaheng/pc/receipt/receiptDetail/domain/ReceiptDetail.java
... ... @@ -166,11 +166,11 @@ public class ReceiptDetail implements Serializable {
166 166 private String attribute3;
167 167  
168 168 /**
169   - * 属性4
  169 + * SNNO 条码
170 170 */
171 171 @TableField(value = "attribute4")
172 172 @ApiModelProperty(value = "属性4")
173   - private String attribute4;
  173 + private String SNNO;
174 174  
175 175 /**
176 176 * 单据数量
... ... @@ -354,6 +354,19 @@ public class ReceiptDetail implements Serializable {
354 354 @ApiModelProperty(value = "流程编码")
355 355 private String statusFlowCode;
356 356  
  357 + /**
  358 + * 是否加急
  359 + */
  360 + @TableField(value = "isUrgent")
  361 + @ApiModelProperty(value = "是否加急")
  362 + private Boolean isUrgent;
  363 +
  364 + /**
  365 + * 通知单号
  366 + */
  367 + @TableField(value = "noticeNo")
  368 + @ApiModelProperty(value = "通知单号")
  369 + private String noticeNo;
357 370  
358 371 public String getCompanyName() {
359 372 return companyName;
... ... @@ -362,4 +375,4 @@ public class ReceiptDetail implements Serializable {
362 375 public void setCompanyName(String companyName) {
363 376 this.companyName = companyName;
364 377 }
365   -}
366 378 \ No newline at end of file
  379 +}
... ...
src/main/java/com/huaheng/pc/receipt/receiptHeader/domain/ReceiptHeader.java
... ... @@ -230,18 +230,18 @@ public class ReceiptHeader implements Serializable {
230 230 private Integer version;
231 231  
232 232 /**
233   - * 自定义字段1
  233 + * MOM目标类型
234 234 */
235 235 @TableField(value = "userDef1")
236 236 @ApiModelProperty(value="自定义字段1")
237   - private String userDef1;
  237 + private String TAID;
238 238  
239 239 /**
240   - * 自定义字段2
  240 + * MOM来源类型
241 241 */
242 242 @TableField(value = "userDef2")
243 243 @ApiModelProperty(value="自定义字段2")
244   - private String userDef2;
  244 + private String FAID;
245 245  
246 246 /**
247 247 * 自定义字段3
... ... @@ -300,4 +300,4 @@ public class ReceiptHeader implements Serializable {
300 300 private Boolean deleted;
301 301  
302 302 private static final long serialVersionUID = 1L;
303   -}
304 303 \ No newline at end of file
  304 +}
... ...
src/main/java/com/huaheng/pc/shipment/shipmentDetail/domain/ShipmentDetail.java
... ... @@ -163,11 +163,11 @@ public class ShipmentDetail implements Serializable {
163 163 private String attribute3;
164 164  
165 165 /**
166   - * 属性4
  166 + * SNNO -- MOM条码
167 167 */
168 168 @TableField(value = "attribute4")
169 169 @ApiModelProperty(value="属性4")
170   - private String attribute4;
  170 + private String SNNO;
171 171  
172 172 /**
173 173 * 批次
... ... @@ -317,5 +317,18 @@ public class ShipmentDetail implements Serializable {
317 317 @ApiModelProperty(value="处理标记")
318 318 private String processStamp;
319 319  
  320 + /**
  321 + * 是否加急
  322 + */
  323 + @TableField(value = "isUrgent")
  324 + @ApiModelProperty(value = "是否加急")
  325 + private Boolean isUrgent;
  326 +
  327 + /**
  328 + * 通知单号
  329 + */
  330 + @TableField(value = "noticeNo")
  331 + @ApiModelProperty(value = "通知单号")
  332 + private String noticeNo;
320 333  
321 334 }
... ...
src/main/java/com/huaheng/pc/shipment/shipmentHeader/domain/ShipmentHeader.java
... ... @@ -343,18 +343,18 @@ public class ShipmentHeader implements Serializable {
343 343 private Integer version;
344 344  
345 345 /**
346   - * 自定义字段1
  346 + * TAID
347 347 */
348 348 @TableField(value = "userDef1")
349 349 @ApiModelProperty(value = "自定义字段1")
350   - private String userDef1;
  350 + private String TAID;
351 351  
352 352 /**
353   - * 自定义字段2
  353 + * FAID
354 354 */
355 355 @TableField(value = "userDef2")
356 356 @ApiModelProperty(value = "自定义字段2")
357   - private String userDef2;
  357 + private String FAID;
358 358  
359 359 /**
360 360 * 自定义字段3
... ... @@ -412,4 +412,4 @@ public class ShipmentHeader implements Serializable {
412 412 @ApiModelProperty(value = "是否删除")
413 413 private Boolean deleted;
414 414  
415   -}
416 415 \ No newline at end of file
  416 +}
... ...