From 82704c9eb336e9b348e4c84aeae3bdfcd10e356b Mon Sep 17 00:00:00 2001
From: Lin-XCC <754310653@QQ.COM>
Date: Mon, 22 Nov 2021 10:34:16 +0800
Subject: [PATCH 01/15] =?UTF-8?q?=E5=AE=8C=E5=96=84APMS=E6=8E=A5=E5=8F=A3?=
=?UTF-8?q?=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../wms/empty/controller/ApmsController.java | 52 +++++++++++++------
.../wms/empty/params/OrderParamForApms.java | 6 +--
.../service/impl/OrderInfoServiceImpl.java | 16 +++++-
3 files changed, 54 insertions(+), 20 deletions(-)
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ApmsController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ApmsController.java
index 3770983..b4a7972 100644
--- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ApmsController.java
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ApmsController.java
@@ -1,5 +1,6 @@
package com.mt.wms.empty.controller;
+import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSON;
@@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import java.time.LocalDateTime;
import java.util.HashMap;
/**
@@ -40,6 +42,7 @@ public class ApmsController extends BaseController {
private CommunicationLogServiceBiz communicationLogServiceBiz;
static String Token = "";
+ static LocalDateTime TokenExpireTime = LocalDateTime.now();
static String ApiAddress = "http://59.110.171.25:9010";
@PostMapping(value = "apmsPostOrder")
@@ -47,8 +50,9 @@ public class ApmsController extends BaseController {
public R apmsPostOrder(@Validated @RequestBody OrderParamForApms apmsPostOrderParam) {
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
- communicationLog.setLogName("Wms接收Apms订单");
+ communicationLog.setLogName("WMS接收APMS订单");
communicationLog.setContent(apmsPostOrderParam.toString());
+ communicationLog.setType(3);
setCommonField(communicationLog);
communicationLogServiceBiz.save(communicationLog);
return orderInfoService.apmsPostOrder(apmsPostOrderParam);
@@ -60,6 +64,7 @@ public class ApmsController extends BaseController {
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
communicationLog.setLogName("APMS作废订单");
+ communicationLog.setType(3);
communicationLog.setContent(idenCardNum);
setCommonField(communicationLog);
communicationLogServiceBiz.save(communicationLog);
@@ -67,19 +72,21 @@ public class ApmsController extends BaseController {
}
@PostMapping(value = "apmsCompleteOrder")
- @ApiOperation(value = "APMS完成订单")
+ @ApiOperation(value = "APMS完成订单,返回加工单检验结果")
public R apmsCompleteOrder(@Validated @RequestBody ApmsCompleteOrder apmsCompleteOrder) {
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
- communicationLog.setLogName("APMS完成订单");
+ communicationLog.setLogName("APMS完成订单,返回WMS加工单检验结果");
+ communicationLog.setType(3);
communicationLog.setContent(apmsCompleteOrder.toString());
setCommonField(communicationLog);
communicationLogServiceBiz.save(communicationLog);
+ //APMS完成订单,返回检验结果,更新结果和后续处理
return orderInfoService.apmsCompleteOrder(apmsCompleteOrder);
}
@PostMapping(value = "createProcessSheet")
- @ApiOperation(value = "APMS创建生产单接口")
+ @ApiOperation(value = "通知APMS创建生产单接口")
public R createProcessSheet(@Validated @RequestBody ApmsCreateProcessSheet apmsCreateProcess) {
checkToken();
HashMap paramMap = new HashMap<>();
@@ -88,8 +95,9 @@ public class ApmsController extends BaseController {
.header("token", Token).form(paramMap).execute();
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
- communicationLog.setLogName("APMS创建生产单");
- communicationLog.setContent(paramMap.toString());
+ communicationLog.setLogName("WMS通知APMS创建生产单");
+ communicationLog.setType(2);
+ communicationLog.setContent("param:" + paramMap + "\nresult:" + response.body());
setCommonField(communicationLog);
communicationLogServiceBiz.save(communicationLog);
return successful(response);
@@ -105,15 +113,16 @@ public class ApmsController extends BaseController {
.header("token", Token).form(paramMap).execute();
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
- communicationLog.setLogName("通知APMS生产单开始处理");
- communicationLog.setContent(paramMap.toString());
+ communicationLog.setLogName("WMS通知APMS生产单开始处理");
+ communicationLog.setType(2);
+ communicationLog.setContent("param:" + paramMap + "\nresult:" + response.body());
setCommonField(communicationLog);
communicationLogServiceBiz.save(communicationLog);
return successful(response);
}
@PostMapping(value = "endProcess")
- @ApiOperation(value = "通知APMS订单结束处理")
+ @ApiOperation(value = "通知APMS生产单结束处理")
public R endProcess(@Validated @RequestBody ApmsEndProcess apmsEndProcess) {
checkToken();
HashMap paramMap = new HashMap<>();
@@ -122,8 +131,9 @@ public class ApmsController extends BaseController {
.header("token", Token).form(paramMap).execute();
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
- communicationLog.setLogName("通知APMS订单结束处理");
- communicationLog.setContent(paramMap.toString());
+ communicationLog.setLogName("WMS通知APMS生产单结束处理");
+ communicationLog.setType(2);
+ communicationLog.setContent("param:" + paramMap + "\nresult:" + response.body());
setCommonField(communicationLog);
communicationLogServiceBiz.save(communicationLog);
return successful(response);
@@ -139,8 +149,9 @@ public class ApmsController extends BaseController {
.header("token", Token).form(paramMap).execute();
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
- communicationLog.setLogName("通知APMS完成生产单接口");
- communicationLog.setContent(paramMap.toString());
+ communicationLog.setLogName("WMS通知APMS完成生产单");
+ communicationLog.setType(2);
+ communicationLog.setContent("param:" + paramMap + "\nresult:" + response.body());
setCommonField(communicationLog);
communicationLogServiceBiz.save(communicationLog);
return successful(response);
@@ -155,11 +166,14 @@ public class ApmsController extends BaseController {
String result = HttpUtil.get(ApiAddress + "/platform/api/getToken", paramMap);
JSON parse = JSONUtil.parse(result);
Object token = parse.getByPath("token");
+ String expireTime = parse.getByPath("expireTime").toString();
Token = token.toString();
+ TokenExpireTime = LocalDateTimeUtil.parse(expireTime);
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
- communicationLog.setLogName("获取APMS Token");
- communicationLog.setContent(paramMap.toString());
+ communicationLog.setLogName("WMS获取APMS Token");
+ communicationLog.setType(2);
+ communicationLog.setContent("param:" + paramMap + "\nresult:" + result);
setCommonField(communicationLog);
communicationLogServiceBiz.save(communicationLog);
return successful(result);
@@ -173,10 +187,12 @@ public class ApmsController extends BaseController {
paramMap.put("workShopCode", workShopCode);
HttpResponse response = HttpUtil.createGet(ApiAddress + "/platform/api/getStoveCodeByWorkShopCode")
.header("token", Token).form(paramMap).execute();
+ System.out.println(response.body());
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
communicationLog.setLogName("APMS通过车间编码获取炉号信息");
- communicationLog.setContent(paramMap.toString());
+ communicationLog.setType(2);
+ communicationLog.setContent("param:" + paramMap + "\nresult:" + response.body());
setCommonField(communicationLog);
communicationLogServiceBiz.save(communicationLog);
return successful(response);
@@ -187,5 +203,9 @@ public class ApmsController extends BaseController {
{
getApmsToken();
}
+ else if (TokenExpireTime.isBefore(LocalDateTime.now()))
+ {
+ getApmsToken();
+ }
}
}
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/OrderParamForApms.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/OrderParamForApms.java
index 513cde0..fe7a8de 100644
--- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/OrderParamForApms.java
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/OrderParamForApms.java
@@ -15,7 +15,7 @@ import lombok.experimental.Accessors;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
-@ApiModel(value = "apms订单对象", description = "用于推送新的订单信息")
+@ApiModel(value = "apms订单对象", description = "用于APMS推送新的订单信息")
public class OrderParamForApms extends BaseParam {
private static final long serialVersionUID = 1L;
@@ -68,10 +68,10 @@ public class OrderParamForApms extends BaseParam {
@ApiModelProperty(value = "工艺要求")
private String craftIll;
- @ApiModelProperty(value = "加工数量")
+ @ApiModelProperty(value = "加工数量", required = true)
private Float quantity;
- @ApiModelProperty(value = "加工重量")
+ @ApiModelProperty(value = "加工重量", required = true)
private Float weight;
@ApiModelProperty(value = "单位")
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java
index 632a5f6..82b26e9 100644
--- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoServiceImpl.java
@@ -11,8 +11,10 @@ import com.mt.wms.basic.vo.KilnInfoVo;
import com.mt.wms.basic.vo.VehicleVo;
import com.mt.wms.core.api.Assert;
import com.mt.wms.core.base.BaseService;
+import com.mt.wms.core.dal.entity.ApmsCheckResult;
import com.mt.wms.core.dal.entity.CurrTaskDet;
import com.mt.wms.core.dal.entity.OrderInfo;
+import com.mt.wms.core.dal.service.ApmsCheckResultServiceBiz;
import com.mt.wms.core.dal.service.CommunicationLogServiceBiz;
import com.mt.wms.core.dal.service.OrderInfoServiceBiz;
import com.mt.wms.core.params.IdParam;
@@ -34,6 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@@ -69,6 +72,9 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
@Autowired
CommunicationLogServiceBiz communicationLogServiceBiz;
+
+ @Autowired
+ ApmsCheckResultServiceBiz apmsCheckResultServiceBiz;
@Autowired
ApmsController apmsControl;
@@ -201,6 +207,14 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic
@Override
public R apmsCompleteOrder(ApmsCompleteOrder apmsCompleteOrder) {
- return null;
+ //通过标识卡号与生产单号进行更新检验结果
+ ApmsCheckResult one = apmsCheckResultServiceBiz.getOne(new QueryWrapper().eq(ApmsCheckResult.IDEN_CARD_NUM, apmsCompleteOrder.getIdenCardNum()).eq(ApmsCheckResult.SHEET_NO, apmsCompleteOrder.getSheetNo()));
+ one.setMetallography(apmsCompleteOrder.getMetallographic());
+ one.setHeartHardness(apmsCompleteOrder.getHeartHardness());
+ one.setHardness(apmsCompleteOrder.getHardness());
+ one.setUpdateTime(LocalDateTime.now());
+ apmsCheckResultServiceBiz.updateById(one);
+ OrderInfo one1 = orderInfoService.getOne(new QueryWrapper().eq(OrderInfo.IDEN_CARD_NUM, apmsCompleteOrder.getIdenCardNum()));
+ return completeOrder(IdParam.builder().id(one1.getId()).build());
}
}
From 8e46276be0abc30fda3ed8ade5b3924138108a00 Mon Sep 17 00:00:00 2001
From: Lin-XCC <754310653@QQ.COM>
Date: Mon, 22 Nov 2021 15:23:29 +0800
Subject: [PATCH 02/15] =?UTF-8?q?=E6=B5=8B=E8=AF=95apms=EF=BC=8C=E4=BC=98?=
=?UTF-8?q?=E5=8C=96bug=EF=BC=8C=E4=BC=98=E5=8C=96=E8=BF=94=E5=9B=9E?=
=?UTF-8?q?=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../wms/empty/controller/ApmsController.java | 49 ++++++++++---------
.../empty/params/ApmsCreateProcessSheet.java | 4 +-
.../empty/params/ApmsFinishProcessSheet.java | 4 +-
.../empty/vo/ApmsCreateProcessSheetVo.java | 40 +++++++++++++++
.../com/mt/wms/empty/vo/ApmsEndProcessVo.java | 34 +++++++++++++
.../empty/vo/ApmsFinishProcessSheetVo.java | 40 +++++++++++++++
.../mt/wms/empty/vo/ApmsStartProcessVo.java | 34 +++++++++++++
.../java/com/mt/wms/empty/vo/ApmsStoveVo.java | 43 ++++++++++++++++
8 files changed, 220 insertions(+), 28 deletions(-)
create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsCreateProcessSheetVo.java
create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsEndProcessVo.java
create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsFinishProcessSheetVo.java
create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsStartProcessVo.java
create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsStoveVo.java
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ApmsController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ApmsController.java
index b4a7972..0152193 100644
--- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ApmsController.java
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/ApmsController.java
@@ -1,6 +1,6 @@
package com.mt.wms.empty.controller;
-import cn.hutool.core.date.LocalDateTimeUtil;
+import cn.hutool.http.ContentType;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSON;
@@ -12,6 +12,10 @@ import com.mt.wms.core.dal.service.CommunicationLogServiceBiz;
import com.mt.wms.core.vo.R;
import com.mt.wms.empty.params.*;
import com.mt.wms.empty.service.OrderInfoService;
+import com.mt.wms.empty.vo.ApmsCreateProcessSheetVo;
+import com.mt.wms.empty.vo.ApmsEndProcessVo;
+import com.mt.wms.empty.vo.ApmsFinishProcessSheetVo;
+import com.mt.wms.empty.vo.ApmsStoveVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -23,6 +27,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
import java.util.HashMap;
/**
@@ -41,6 +46,7 @@ public class ApmsController extends BaseController {
@Autowired
private CommunicationLogServiceBiz communicationLogServiceBiz;
+ // static String Token = "eyJhbGciOiJIUzI1NiJ9.eyJkYXRlIjozMTkyNzU4NDk4ODA3LCJwbGF0Rm9ybUlkIjoyLCJhcGlLZXkiOiI3ZWU4ZjU5YmJhZWFlMjdlIiwiZXhwIjozMTkyNzU4NDk4LCJpYXQiOjE2Mzc1NTg0OTh9.RH3MRQr1dCBYW996-WXN69eXu1ZFblAQHfhZHNbTmCg";
static String Token = "";
static LocalDateTime TokenExpireTime = LocalDateTime.now();
static String ApiAddress = "http://59.110.171.25:9010";
@@ -89,72 +95,68 @@ public class ApmsController extends BaseController {
@ApiOperation(value = "通知APMS创建生产单接口")
public R createProcessSheet(@Validated @RequestBody ApmsCreateProcessSheet apmsCreateProcess) {
checkToken();
- HashMap paramMap = new HashMap<>();
- paramMap.put("entity", apmsCreateProcess);
+ String paramJson = JSONUtil.toJsonStr(apmsCreateProcess);
HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/createProcessSheet")
- .header("token", Token).form(paramMap).execute();
+ .header("token", Token).body(paramJson, ContentType.JSON.toString()).execute();
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
communicationLog.setLogName("WMS通知APMS创建生产单");
communicationLog.setType(2);
- communicationLog.setContent("param:" + paramMap + "\nresult:" + response.body());
+ communicationLog.setContent("param:" + paramJson + "\nresult:" + response.body());
setCommonField(communicationLog);
communicationLogServiceBiz.save(communicationLog);
- return successful(response);
+ return successful(JSONUtil.toBean(response.body(), ApmsCreateProcessSheetVo.class));
}
@PostMapping(value = "startProcess")
@ApiOperation(value = "通知APMS生产单开始处理")
public R startProcess(@Validated @RequestBody ApmsStartProcess apmsStartProcess) {
checkToken();
- HashMap paramMap = new HashMap<>();
- paramMap.put("entity", apmsStartProcess);
+ String paramJson = JSONUtil.toJsonStr(apmsStartProcess);
HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/startProcess")
- .header("token", Token).form(paramMap).execute();
+ .header("token", Token).body(paramJson, ContentType.JSON.toString()).execute();
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
communicationLog.setLogName("WMS通知APMS生产单开始处理");
communicationLog.setType(2);
- communicationLog.setContent("param:" + paramMap + "\nresult:" + response.body());
+ communicationLog.setContent("param:" + paramJson + "\nresult:" + response.body());
setCommonField(communicationLog);
communicationLogServiceBiz.save(communicationLog);
- return successful(response);
+ return successful(JSONUtil.toBean(response.body(), ApmsStartProcess.class));
}
@PostMapping(value = "endProcess")
@ApiOperation(value = "通知APMS生产单结束处理")
public R endProcess(@Validated @RequestBody ApmsEndProcess apmsEndProcess) {
checkToken();
- HashMap paramMap = new HashMap<>();
- paramMap.put("entity", apmsEndProcess);
+ String paramJson = JSONUtil.toJsonStr(apmsEndProcess);
HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/endProcess")
- .header("token", Token).form(paramMap).execute();
+ .header("token", Token).body(paramJson, ContentType.JSON.toString()).execute();
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
communicationLog.setLogName("WMS通知APMS生产单结束处理");
communicationLog.setType(2);
- communicationLog.setContent("param:" + paramMap + "\nresult:" + response.body());
+ communicationLog.setContent("param:" + paramJson + "\nresult:" + response.body());
setCommonField(communicationLog);
communicationLogServiceBiz.save(communicationLog);
- return successful(response);
+ return successful(JSONUtil.toBean(response.body(), ApmsEndProcessVo.class));
}
@PostMapping(value = "finishProcessSheet")
@ApiOperation(value = "通知APMS完成生产单接口")
public R finishProcessSheet(@Validated @RequestBody ApmsFinishProcessSheet apmsFinishProcessSheet) {
checkToken();
- HashMap paramMap = new HashMap<>();
- paramMap.put("entity", apmsFinishProcessSheet);
+ String paramJson = JSONUtil.toJsonStr(apmsFinishProcessSheet);
HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/finishProcessSheet")
- .header("token", Token).form(paramMap).execute();
+ .header("token", Token).body(paramJson, ContentType.JSON.toString()).execute();
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
communicationLog.setLogName("WMS通知APMS完成生产单");
communicationLog.setType(2);
- communicationLog.setContent("param:" + paramMap + "\nresult:" + response.body());
+ communicationLog.setContent("param:" + paramJson + "\nresult:" + response.body());
setCommonField(communicationLog);
communicationLogServiceBiz.save(communicationLog);
- return successful(response);
+ return successful(JSONUtil.toBean(response.body(), ApmsFinishProcessSheetVo.class));
}
@PostMapping(value = "getApmsToken")
@@ -168,7 +170,7 @@ public class ApmsController extends BaseController {
Object token = parse.getByPath("token");
String expireTime = parse.getByPath("expireTime").toString();
Token = token.toString();
- TokenExpireTime = LocalDateTimeUtil.parse(expireTime);
+ TokenExpireTime = LocalDateTime.parse(expireTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
communicationLog.setLogName("WMS获取APMS Token");
@@ -187,7 +189,6 @@ public class ApmsController extends BaseController {
paramMap.put("workShopCode", workShopCode);
HttpResponse response = HttpUtil.createGet(ApiAddress + "/platform/api/getStoveCodeByWorkShopCode")
.header("token", Token).form(paramMap).execute();
- System.out.println(response.body());
CommunicationLog communicationLog = new CommunicationLog();
communicationLog.setCode("APMS" + System.currentTimeMillis());
communicationLog.setLogName("APMS通过车间编码获取炉号信息");
@@ -195,7 +196,7 @@ public class ApmsController extends BaseController {
communicationLog.setContent("param:" + paramMap + "\nresult:" + response.body());
setCommonField(communicationLog);
communicationLogServiceBiz.save(communicationLog);
- return successful(response);
+ return successful(JSONUtil.toBean(response.body(), ApmsStoveVo.class));
}
private void checkToken() {
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsCreateProcessSheet.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsCreateProcessSheet.java
index 0422593..d7d82f3 100644
--- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsCreateProcessSheet.java
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsCreateProcessSheet.java
@@ -51,8 +51,8 @@ class CreateItem extends BaseParam {
private String itemCode;
@ApiModelProperty(value = "加工数量", required = true)
- private String quantity;
+ private Integer quantity;
@ApiModelProperty(value = "加工重量", required = true)
- private String weight;
+ private Double weight;
}
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsFinishProcessSheet.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsFinishProcessSheet.java
index a43e462..eb77ea5 100644
--- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsFinishProcessSheet.java
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsFinishProcessSheet.java
@@ -44,8 +44,8 @@ class FinishItem extends BaseParam {
private String itemCode;
@ApiModelProperty(value = "完成加工数量", required = true)
- private String finishQuantity;
+ private Integer finishQuantity;
@ApiModelProperty(value = "完成加工重量", required = true)
- private String finishWeight;
+ private Double finishWeight;
}
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsCreateProcessSheetVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsCreateProcessSheetVo.java
new file mode 100644
index 0000000..fd83f13
--- /dev/null
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsCreateProcessSheetVo.java
@@ -0,0 +1,40 @@
+package com.mt.wms.empty.vo;
+
+import com.mt.wms.core.base.BaseVo;
+import io.swagger.annotations.ApiModel;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @author xcc
+ * @date 2021年11月8日
+ * @since 1.0
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Builder
+@ApiModel(value = "APMS返回创建生产单信息", description = "APMS返回创建生产单信息")
+public class ApmsCreateProcessSheetVo extends BaseVo {
+ /**
+ * 返回消息,返回false时为失败原因
+ */
+ private String msg;
+
+ /**
+ * 是否成功
+ */
+ private Boolean success;
+
+ /**
+ * 生产单编号,创建成功后返回,需要记录此生产单编号,加工过程处理及结束加工处理需要传入此生产单编号
+ */
+ private String sheetNo;
+
+ /**
+ * 返回状态编码:00-正常,01-token失败,02-参数错误,03-其他错误
+ */
+ private String statusCode;
+}
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsEndProcessVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsEndProcessVo.java
new file mode 100644
index 0000000..4a32894
--- /dev/null
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsEndProcessVo.java
@@ -0,0 +1,34 @@
+package com.mt.wms.empty.vo;
+
+import com.mt.wms.core.base.BaseVo;
+import io.swagger.annotations.ApiModel;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @author xcc
+ * @date 2021年11月8日
+ * @since 1.0
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Builder
+@ApiModel(value = "APMS返回生产单结束信息", description = "APMS返回生产单结束信息")
+public class ApmsEndProcessVo extends BaseVo {
+ /**
+ * 返回消息,返回false时为失败原因
+ */
+ private String msg;
+
+ /**
+ * 是否成功
+ */
+ private Boolean success;
+ /**
+ * 返回状态编码:00-正常,01-token失败,02-参数错误,03-其他错误
+ */
+ private String statusCode;
+}
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsFinishProcessSheetVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsFinishProcessSheetVo.java
new file mode 100644
index 0000000..9ff9d58
--- /dev/null
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsFinishProcessSheetVo.java
@@ -0,0 +1,40 @@
+package com.mt.wms.empty.vo;
+
+import com.mt.wms.core.base.BaseVo;
+import io.swagger.annotations.ApiModel;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @author xcc
+ * @date 2021年11月8日
+ * @since 1.0
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Builder
+@ApiModel(value = "APMS返回完成生产单信息", description = "APMS返回完成生产单信息")
+public class ApmsFinishProcessSheetVo extends BaseVo {
+ /**
+ * 返回消息,返回false时为失败原因
+ */
+ private String msg;
+
+ /**
+ * 是否成功
+ */
+ private Boolean success;
+
+ /**
+ * 生产单编号,创建成功后返回,需要记录此生产单编号,加工过程处理及结束加工处理需要传入此生产单编号
+ */
+ private String sheetNo;
+
+ /**
+ * 返回状态编码:00-正常,01-token失败,02-参数错误,03-其他错误
+ */
+ private String statusCode;
+}
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsStartProcessVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsStartProcessVo.java
new file mode 100644
index 0000000..e091db5
--- /dev/null
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsStartProcessVo.java
@@ -0,0 +1,34 @@
+package com.mt.wms.empty.vo;
+
+import com.mt.wms.core.base.BaseVo;
+import io.swagger.annotations.ApiModel;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @author xcc
+ * @date 2021年11月8日
+ * @since 1.0
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Builder
+@ApiModel(value = "APMS返回生产单开始信息", description = "APMS返回生产单开始信息")
+public class ApmsStartProcessVo extends BaseVo {
+ /**
+ * 返回消息,返回false时为失败原因
+ */
+ private String msg;
+
+ /**
+ * 是否成功
+ */
+ private Boolean success;
+ /**
+ * 返回状态编码:00-正常,01-token失败,02-参数错误,03-其他错误
+ */
+ private String statusCode;
+}
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsStoveVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsStoveVo.java
new file mode 100644
index 0000000..e91f063
--- /dev/null
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/ApmsStoveVo.java
@@ -0,0 +1,43 @@
+package com.mt.wms.empty.vo;
+
+import com.mt.wms.core.base.BaseVo;
+import io.swagger.annotations.ApiModel;
+import lombok.Builder;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+import java.util.ArrayList;
+import java.util.Map;
+
+/**
+ * @author xcc
+ * @date 2021年11月8日
+ * @since 1.0
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@Builder
+@ApiModel(value = "APMS返回窑炉信息", description = "APMS返回窑炉信息")
+public class ApmsStoveVo extends BaseVo {
+ /**
+ * 返回消息,返回false时为失败原因
+ */
+ private String msg;
+
+ /**
+ * 是否成功
+ */
+ private Boolean success;
+
+ /**
+ * 返回状态编码:00-正常,01-token失败,02-参数错误,03-其他错误
+ */
+ private String statusCode;
+
+ /**
+ * 车间炉号信息明细
+ */
+ private ArrayList
*
* @author mt
- * @since 2021-11-25
+ * @since 2021-12-08
*/
@Data
@EqualsAndHashCode(callSuper = false)
@@ -174,6 +174,12 @@ public class CurrTask extends Model {
@TableField("location_name")
private String locationName;
+ /**
+ * 窑炉工艺号
+ */
+ @TableField("craft_code")
+ private String craftCode;
+
public static final String ID = "id";
@@ -225,6 +231,8 @@ public class CurrTask extends Model {
public static final String LOCATION_NAME = "location_name";
+ public static final String CRAFT_CODE = "craft_code";
+
@Override
protected Serializable pkVal() {
return this.id;
diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/TaskHis.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/TaskHis.java
index cf30ad8..a7149c6 100644
--- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/TaskHis.java
+++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/TaskHis.java
@@ -15,7 +15,7 @@ import java.time.LocalDateTime;
*
*
* @author mt
- * @since 2021-11-25
+ * @since 2021-12-08
*/
@Data
@EqualsAndHashCode(callSuper = false)
@@ -174,6 +174,12 @@ public class TaskHis extends Model {
@TableField("location_name")
private String locationName;
+ /**
+ * 窑炉工艺号
+ */
+ @TableField("craft_code")
+ private String craftCode;
+
public static final String ID = "id";
@@ -225,6 +231,8 @@ public class TaskHis extends Model {
public static final String LOCATION_NAME = "location_name";
+ public static final String CRAFT_CODE = "craft_code";
+
@Override
protected Serializable pkVal() {
return this.id;
diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CurrTaskMapper.xml b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CurrTaskMapper.xml
index d4fe1bd..dd75888 100644
--- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CurrTaskMapper.xml
+++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CurrTaskMapper.xml
@@ -29,13 +29,14 @@
+
id, valid, create_time, creator_id, updater_id, update_time, version, status, inter_code, task_code, sheet_no,
task_source, task_type, process_type, pallet_code, a_begin_time, a_end_time, start_position, target_position,
- kiln_id, kiln_name, vehicle_id, is_cache, location_id, location_name
+ kiln_id, kiln_name, vehicle_id, is_cache, location_id, location_name, craft_code
diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/TaskHisMapper.xml b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/TaskHisMapper.xml
index 7c9d21d..09756ee 100644
--- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/TaskHisMapper.xml
+++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/TaskHisMapper.xml
@@ -29,13 +29,14 @@
+
id, valid, create_time, creator_id, updater_id, update_time, version, status, inter_code, task_code, sheet_no,
task_source, task_type, process_type, pallet_code, a_begin_time, a_end_time, start_position, target_position,
- kiln_id, kiln_name, vehicle_id, is_cache, location_id, location_name
+ kiln_id, kiln_name, vehicle_id, is_cache, location_id, location_name, craft_code
From 0b5c7886a6336b7485f7c16a306f6c9004f0ffc0 Mon Sep 17 00:00:00 2001
From: Lin-XCC <754310653@QQ.COM>
Date: Wed, 8 Dec 2021 16:20:57 +0800
Subject: [PATCH 11/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BC=BA=E5=B0=91?=
=?UTF-8?q?=E7=9A=84=E5=89=8D=E5=8F=B0=E8=BF=94=E5=9B=9E=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/mt/wms/empty/vo/CurrTaskDetVo.java | 5 ++++-
.../java/com/mt/wms/empty/vo/CurrTaskQueryVo.java | 14 ++++++++++++++
.../java/com/mt/wms/empty/vo/TaskHisDetVo.java | 5 ++++-
.../java/com/mt/wms/empty/vo/TaskHisQueryVo.java | 10 ++++++++++
4 files changed, 32 insertions(+), 2 deletions(-)
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskDetVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskDetVo.java
index 25f32f4..c0c7f09 100644
--- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskDetVo.java
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskDetVo.java
@@ -41,7 +41,10 @@ public class CurrTaskDetVo extends BaseVo implements PageVo.ConvertVo {
*/
@ApiModelProperty("任务编码")
private String taskCode;
-
+ @ApiModelProperty("客户名")
+ private String customer;
+ @ApiModelProperty("订单名")
+ private String orderNo;
/**
* 当前任务id,关联当前任务表:t_curr_task
*/
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskQueryVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskQueryVo.java
index d41b02e..94b3c15 100644
--- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskQueryVo.java
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskQueryVo.java
@@ -51,6 +51,20 @@ public class CurrTaskQueryVo extends BaseVo implements PageVo.ConvertVo {
*/
@ApiModelProperty("任务类型")
private Integer taskType;
+ /**
+ * 开始加工时间
+ */
+ @ApiModelProperty("开始加工时间")
+ private LocalDateTime aBeginTime;
+
+ /**
+ * 加工完成时间
+ */
+ @ApiModelProperty("加工完成时间")
+ private LocalDateTime aEndTime;
+
+ @ApiModelProperty("窑炉工艺号")
+ private String craftCode;
/**
* 开始位置
*/
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisDetVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisDetVo.java
index 9ba4498..de5e609 100644
--- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisDetVo.java
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisDetVo.java
@@ -40,7 +40,10 @@ public class TaskHisDetVo extends BaseVo implements PageVo.ConvertVo {
*/
@ApiModelProperty("任务编码")
private String taskCode;
-
+ @ApiModelProperty("客户名")
+ private String customer;
+ @ApiModelProperty("订单名")
+ private String orderNo;
/**
* 历史任务id,关联当前任务表:t_task_his
*/
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisQueryVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisQueryVo.java
index 81bd01f..ba67b75 100644
--- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisQueryVo.java
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisQueryVo.java
@@ -55,7 +55,17 @@ public class TaskHisQueryVo extends BaseVo implements PageVo.ConvertVo {
*/
@ApiModelProperty("开始位置")
private String startPosition;
+ /**
+ * 开始加工时间
+ */
+ @ApiModelProperty("开始加工时间")
+ private LocalDateTime aBeginTime;
+ /**
+ * 加工完成时间
+ */
+ @ApiModelProperty("加工完成时间")
+ private LocalDateTime aEndTime;
/**
* 目标位置指的是窑炉的位置
*/
From 9c4e091956f38be4c33a014955b846201d35179d Mon Sep 17 00:00:00 2001
From: Lin-XCC <754310653@QQ.COM>
Date: Wed, 8 Dec 2021 16:22:22 +0800
Subject: [PATCH 12/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=94=9F=E4=BA=A7?=
=?UTF-8?q?=E5=8D=95=E4=BB=BB=E5=8A=A1=E5=88=9B=E5=BB=BA=E7=9A=84=E9=80=BB?=
=?UTF-8?q?=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../empty/controller/CurrTaskController.java | 79 ++++++++++++++++++-
.../mt/wms/empty/params/TaskCreateParam.java | 4 +-
.../mt/wms/empty/service/CurrTaskService.java | 16 ++++
.../service/impl/CurrTaskDetServiceImpl.java | 1 +
.../service/impl/CurrTaskServiceImpl.java | 10 +++
.../service/impl/OrderInfoHisServiceImpl.java | 2 +-
.../service/impl/TaskDetHisServiceImpl.java | 1 +
7 files changed, 107 insertions(+), 6 deletions(-)
diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskController.java
index a821c5c..18c17a3 100644
--- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskController.java
+++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskController.java
@@ -1,17 +1,24 @@
package com.mt.wms.empty.controller;
+import com.mt.wms.basic.service.KilnInfoService;
+import com.mt.wms.basic.vo.KilnInfoVo;
import com.mt.wms.core.base.BaseController;
import com.mt.wms.core.constants.CommonConstant;
+import com.mt.wms.core.dal.entity.CurrTask;
import com.mt.wms.core.params.BasePageParam;
import com.mt.wms.core.params.IdParam;
import com.mt.wms.core.vo.IdVo;
import com.mt.wms.core.vo.PageVo;
import com.mt.wms.core.vo.R;
+import com.mt.wms.empty.params.ApmsCreateProcessSheet;
+import com.mt.wms.empty.params.CreateItem;
import com.mt.wms.empty.params.CurrTaskQueryParam;
import com.mt.wms.empty.params.TaskCreateParam;
import com.mt.wms.empty.service.CurrTaskDetService;
import com.mt.wms.empty.service.CurrTaskService;
import com.mt.wms.empty.service.OrderInfoService;
+import com.mt.wms.empty.vo.ApmsCreateProcessSheetVo;
+import com.mt.wms.empty.vo.ApmsStoveVo;
import com.mt.wms.empty.vo.CurrTaskMainQueryVo;
import com.mt.wms.empty.vo.CurrTaskQueryVo;
import io.swagger.annotations.Api;
@@ -24,6 +31,11 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.ArrayList;
+import java.util.Map;
+
/**
* @author xcc
* @date 2021年11月8日
@@ -40,21 +52,80 @@ public class CurrTaskController extends BaseController {
private CurrTaskDetService currTaskDetService;
@Autowired
private OrderInfoService orderInfoService;
+ @Autowired
+ private ApmsController apmsControl;
+ @Autowired
+ private KilnInfoService kilnInfoService;
@PostMapping(value = "createProcessTask")
@ApiOperation(value = "订单加工-创建一个加工任务至任务队列")
public R createProcessTask(@Validated @RequestBody TaskCreateParam param) {
//验证标识卡号正确无误。
orderInfoService.verifyTaskInfoByIdenCardNum(param.getDetParams());
- R mainTask = currTaskService.createProcessTask(param);
- currTaskDetService.createProcessTaskDet(param.getDetParams(), mainTask.getData().getId());
- return successful("创建成功,任务添加至等待执行队列。");
+ //验证炉子编码信息在apms正确无误
+ R kilnInfoVoR = kilnInfoService.get(IdParam.builder().id(param.getKilnId()).build());
+ String kilnCode = kilnInfoVoR.getData().getCode();
+ R bm = apmsControl.getStoveCodeByWorkShopCode("BM");
+ ArrayList