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> stoveCodes; +} From 7312fb765bae4f42d5a04d0c875f88bd671d8a32 Mon Sep 17 00:00:00 2001 From: Lin-XCC <754310653@QQ.COM> Date: Wed, 24 Nov 2021 09:02:33 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E4=BC=98=E5=8C=96R=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/empty/controller/ApmsController.java | 18 +++++++++--------- .../mt/wms/empty/service/CurrTaskService.java | 2 +- .../mt/wms/empty/service/OrderInfoService.java | 14 ++++++++------ .../wms/empty/service/TaskDetHisService.java | 4 ++-- .../service/impl/CurrTaskServiceImpl.java | 2 +- .../service/impl/OrderInfoServiceImpl.java | 16 ++++++++-------- .../service/impl/TaskDetHisServiceImpl.java | 6 +++--- 7 files changed, 32 insertions(+), 30 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 0152193..7f9168c 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 @@ -53,7 +53,7 @@ public class ApmsController extends BaseController { @PostMapping(value = "apmsPostOrder") @ApiOperation(value = "接收APMS推送订单信息") - public R apmsPostOrder(@Validated @RequestBody OrderParamForApms apmsPostOrderParam) { + public R apmsPostOrder(@Validated @RequestBody OrderParamForApms apmsPostOrderParam) { CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); communicationLog.setLogName("WMS接收APMS订单"); @@ -66,7 +66,7 @@ public class ApmsController extends BaseController { @PostMapping(value = "apmsVoidOrder") @ApiOperation(value = "APMS作废订单") - public R apmsVoidOrder(@Validated @RequestBody String idenCardNum) { + public R apmsVoidOrder(@Validated @RequestBody String idenCardNum) { CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); communicationLog.setLogName("APMS作废订单"); @@ -79,7 +79,7 @@ public class ApmsController extends BaseController { @PostMapping(value = "apmsCompleteOrder") @ApiOperation(value = "APMS完成订单,返回加工单检验结果") - public R apmsCompleteOrder(@Validated @RequestBody ApmsCompleteOrder apmsCompleteOrder) { + public R apmsCompleteOrder(@Validated @RequestBody ApmsCompleteOrder apmsCompleteOrder) { CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); communicationLog.setLogName("APMS完成订单,返回WMS加工单检验结果"); @@ -93,7 +93,7 @@ public class ApmsController extends BaseController { @PostMapping(value = "createProcessSheet") @ApiOperation(value = "通知APMS创建生产单接口") - public R createProcessSheet(@Validated @RequestBody ApmsCreateProcessSheet apmsCreateProcess) { + public R createProcessSheet(@Validated @RequestBody ApmsCreateProcessSheet apmsCreateProcess) { checkToken(); String paramJson = JSONUtil.toJsonStr(apmsCreateProcess); HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/createProcessSheet") @@ -110,7 +110,7 @@ public class ApmsController extends BaseController { @PostMapping(value = "startProcess") @ApiOperation(value = "通知APMS生产单开始处理") - public R startProcess(@Validated @RequestBody ApmsStartProcess apmsStartProcess) { + public R startProcess(@Validated @RequestBody ApmsStartProcess apmsStartProcess) { checkToken(); String paramJson = JSONUtil.toJsonStr(apmsStartProcess); HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/startProcess") @@ -127,7 +127,7 @@ public class ApmsController extends BaseController { @PostMapping(value = "endProcess") @ApiOperation(value = "通知APMS生产单结束处理") - public R endProcess(@Validated @RequestBody ApmsEndProcess apmsEndProcess) { + public R endProcess(@Validated @RequestBody ApmsEndProcess apmsEndProcess) { checkToken(); String paramJson = JSONUtil.toJsonStr(apmsEndProcess); HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/endProcess") @@ -144,7 +144,7 @@ public class ApmsController extends BaseController { @PostMapping(value = "finishProcessSheet") @ApiOperation(value = "通知APMS完成生产单接口") - public R finishProcessSheet(@Validated @RequestBody ApmsFinishProcessSheet apmsFinishProcessSheet) { + public R finishProcessSheet(@Validated @RequestBody ApmsFinishProcessSheet apmsFinishProcessSheet) { checkToken(); String paramJson = JSONUtil.toJsonStr(apmsFinishProcessSheet); HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/finishProcessSheet") @@ -161,7 +161,7 @@ public class ApmsController extends BaseController { @PostMapping(value = "getApmsToken") @ApiOperation(value = "获取APMS Token") - public R getApmsToken() { + public R getApmsToken() { HashMap paramMap = new HashMap<>(); paramMap.put("apiKey", "7ee8f59bbaeae27e"); paramMap.put("platFormCode", "CUC"); @@ -183,7 +183,7 @@ public class ApmsController extends BaseController { @PostMapping(value = "getStoveCodeByWorkShopCode") @ApiOperation(value = "APMS通过车间编码获取炉号信息") - public R getStoveCodeByWorkShopCode(String workShopCode) { + public R getStoveCodeByWorkShopCode(String workShopCode) { checkToken(); HashMap paramMap = new HashMap<>(); paramMap.put("workShopCode", workShopCode); diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java index bbb5387..4f1ccec 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java @@ -48,5 +48,5 @@ public interface CurrTaskService { * @param param id * @return 结果 */ - R completeTask(IdParam param); + R completeTask(IdParam param); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/OrderInfoService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/OrderInfoService.java index 409129b..ca8a3c1 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/OrderInfoService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/OrderInfoService.java @@ -21,7 +21,7 @@ public interface OrderInfoService { * @param apmsPostOrderParam 订单参数 * @return 操作结果 */ - R apmsPostOrder(OrderParamForApms apmsPostOrderParam); + R apmsPostOrder(OrderParamForApms apmsPostOrderParam); /** * 查询当前订单列表 @@ -30,13 +30,15 @@ public interface OrderInfoService { * @return 分页结果集 */ R> page(OrderInfoBasePageParam orderInfoBasePageParam); + /** * 人工创建订单 * * @param orderInfoPersonCreateParam 人工订单参数 * @return 结果 */ - R personCreateOrder(OrderInfoPersonCreateParam orderInfoPersonCreateParam); + R personCreateOrder(OrderInfoPersonCreateParam orderInfoPersonCreateParam); + /** * 获取详细单条信息 * @@ -65,7 +67,7 @@ public interface OrderInfoService { * @param idParam id号 * @return 结果 */ - R completeOrder(IdParam idParam); + R completeOrder(IdParam idParam); /** * 作废订单 @@ -73,7 +75,7 @@ public interface OrderInfoService { * @param idParam id号 * @return 结果 */ - R voidOrder(IdParam idParam); + R voidOrder(IdParam idParam); /** * APMS作废订单 @@ -81,7 +83,7 @@ public interface OrderInfoService { * @param idenCardNum 标识卡号 * @return 结果 */ - R apmsVoidOrder(String idenCardNum); + R apmsVoidOrder(String idenCardNum); /** * APMS返回订单结果 @@ -89,6 +91,6 @@ public interface OrderInfoService { * @param apmsCompleteOrder 订单检验结果 * @return 结果 */ - R apmsCompleteOrder(ApmsCompleteOrder apmsCompleteOrder); + R apmsCompleteOrder(ApmsCompleteOrder apmsCompleteOrder); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskDetHisService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskDetHisService.java index 40324fc..3d31a8c 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskDetHisService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskDetHisService.java @@ -22,7 +22,7 @@ public interface TaskDetHisService { * @param taskDetHis 任务详情历史 * @return 结果 */ - R save(TaskDetHis taskDetHis); + R save(TaskDetHis taskDetHis); /** * 保存任务详情历史list @@ -30,7 +30,7 @@ public interface TaskDetHisService { * @param taskDetHis 任务详情历史 * @return 结果 */ - R saveList(List taskDetHis); + R saveList(List taskDetHis); /** * 保存任务详情历史list diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java index 794b613..2073ed8 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java @@ -81,7 +81,7 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService } @Override - public R completeTask(IdParam param) { + public R completeTask(IdParam param) { CurrTask byId = currTaskServiceBiz.getById(param.getId()); TaskHis taskHis = new TaskHis(); BeanUtils.copyProperties(byId, taskHis); 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 82b26e9..9943af0 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 @@ -79,7 +79,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic ApmsController apmsControl; @Override - public R apmsPostOrder(OrderParamForApms apmsPostOrderParam) { + public R apmsPostOrder(OrderParamForApms apmsPostOrderParam) { OrderInfo orderInfo = new OrderInfo(); BeanUtils.copyProperties(apmsPostOrderParam, orderInfo); setCommonField(orderInfo); @@ -102,13 +102,13 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic } @Override - public R personCreateOrder(OrderInfoPersonCreateParam orderInfoPersonCreateParam) { + public R personCreateOrder(OrderInfoPersonCreateParam orderInfoPersonCreateParam) { OrderInfo orderInfo = new OrderInfo(); - BeanUtils.copyProperties(orderInfoPersonCreateParam,orderInfo); + BeanUtils.copyProperties(orderInfoPersonCreateParam, orderInfo); setCommonField(orderInfo); //设定来源信息为人工 orderInfo.setOrderSource(OrderSourceEnum.PERSON.getValue()); - orderInfo.setInterCode("PERSONAL"+System.currentTimeMillis()); + orderInfo.setInterCode("PERSONAL" + System.currentTimeMillis()); orderInfoService.save(orderInfo); return successful("人工创建订单成功。"); } @@ -173,7 +173,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic } @Override - public R completeOrder(IdParam idParam) { + public R completeOrder(IdParam idParam) { OrderInfo byId = orderInfoService.getById(idParam.getId()); orderInfoHisService.save(byId); byId.setValid(0); @@ -183,7 +183,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic } @Override - public R voidOrder(IdParam idParam) { + public R voidOrder(IdParam idParam) { OrderInfo byId = orderInfoService.getById(idParam.getId()); byId.setValid(0); orderInfoService.updateById(byId); @@ -191,7 +191,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic } @Override - public R apmsVoidOrder(String idenCardNum) { + public R apmsVoidOrder(String idenCardNum) { OrderInfo byId = orderInfoService.getOne(new QueryWrapper().eq(OrderInfo.IDEN_CARD_NUM, idenCardNum)); //确定是否有订单在生产 List taskDetailsByIdenCardNum = currTaskDetService.getTaskDetailsByIdenCardNum(idenCardNum); @@ -206,7 +206,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic } @Override - public R apmsCompleteOrder(ApmsCompleteOrder apmsCompleteOrder) { + public R apmsCompleteOrder(ApmsCompleteOrder apmsCompleteOrder) { //通过标识卡号与生产单号进行更新检验结果 ApmsCheckResult one = apmsCheckResultServiceBiz.getOne(new QueryWrapper().eq(ApmsCheckResult.IDEN_CARD_NUM, apmsCompleteOrder.getIdenCardNum()).eq(ApmsCheckResult.SHEET_NO, apmsCompleteOrder.getSheetNo())); one.setMetallography(apmsCompleteOrder.getMetallographic()); diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java index 173410c..b234718 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java @@ -33,15 +33,15 @@ public class TaskDetHisServiceImpl extends BaseService implements TaskDetHisServ @Override - public R save(TaskDetHis taskDetHis) { + public R save(TaskDetHis taskDetHis) { taskDetHisServiceBiz.save(taskDetHis); return successful("操作成功"); } @Override - public R saveList(List taskDetHis) { + public R saveList(List taskDetHis) { taskDetHisServiceBiz.saveBatch(taskDetHis); - return null; + return successful("操作成功"); } @Override From f68b45870fe92fb401964da46abfd7b1bd28fdf3 Mon Sep 17 00:00:00 2001 From: Lin-XCC <754310653@QQ.COM> Date: Fri, 26 Nov 2021 08:50:35 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E6=B7=BB=E5=8A=A0apms=E4=BD=9C=E5=BA=9F?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E5=8D=95=E6=8E=A5=E5=8F=A3=EF=BC=8C=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E8=A1=A8=E6=96=B0=E5=A2=9E=E7=94=9F=E4=BA=A7=E5=8D=95?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mt/wms/core/dal/entity/CurrTask.java | 22 +++++++------ .../com/mt/wms/core/dal/entity/TaskHis.java | 22 +++++++------ .../mt/wms/core/dal/mapper/CurrTaskMapper.xml | 5 ++- .../mt/wms/core/dal/mapper/TaskHisMapper.xml | 5 ++- .../wms/empty/controller/ApmsController.java | 31 +++++++++++++++++-- .../empty/controller/CurrTaskController.java | 10 ++++-- .../wms/empty/service/CurrTaskDetService.java | 8 +++++ .../mt/wms/empty/service/CurrTaskService.java | 8 +++++ .../service/impl/CurrTaskDetServiceImpl.java | 6 ++++ .../service/impl/CurrTaskServiceImpl.java | 28 +++++++++++++++++ 10 files changed, 120 insertions(+), 25 deletions(-) diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CurrTask.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CurrTask.java index 885fb2a..2ad7408 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CurrTask.java +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CurrTask.java @@ -1,25 +1,21 @@ package com.mt.wms.core.dal.entity; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.extension.activerecord.Model; -import com.baomidou.mybatisplus.annotation.Version; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableField; -import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import java.io.Serializable; +import java.time.LocalDateTime; + /** *

* 当前任务 *

* * @author mt - * @since 2021-11-18 + * @since 2021-11-25 */ @Data @EqualsAndHashCode(callSuper = false) @@ -88,6 +84,12 @@ public class CurrTask extends Model { @TableField("task_code") private String taskCode; + /** + * 生产单号 APMS生成生产单后返回 + */ + @TableField("sheet_no") + private String sheetNo; + /** * 任务来源 0:人工 扩展字段 */ @@ -193,6 +195,8 @@ public class CurrTask extends Model { public static final String TASK_CODE = "task_code"; + public static final String SHEET_NO = "sheet_no"; + public static final String TASK_SOURCE = "task_source"; public static final String TASK_TYPE = "task_type"; 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 e1e530b..cf30ad8 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 @@ -1,25 +1,21 @@ package com.mt.wms.core.dal.entity; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.extension.activerecord.Model; -import com.baomidou.mybatisplus.annotation.Version; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableField; -import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import java.io.Serializable; +import java.time.LocalDateTime; + /** *

* 任务历史 *

* * @author mt - * @since 2021-11-18 + * @since 2021-11-25 */ @Data @EqualsAndHashCode(callSuper = false) @@ -88,6 +84,12 @@ public class TaskHis extends Model { @TableField("task_code") private String taskCode; + /** + * 生产单号 APMS生成生产单后返回 + */ + @TableField("sheet_no") + private String sheetNo; + /** * 任务来源 0:人工 扩展字段 */ @@ -193,6 +195,8 @@ public class TaskHis extends Model { public static final String TASK_CODE = "task_code"; + public static final String SHEET_NO = "sheet_no"; + public static final String TASK_SOURCE = "task_source"; public static final String TASK_TYPE = "task_type"; 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 0db46ac..d4fe1bd 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 @@ -14,6 +14,7 @@ + @@ -32,7 +33,9 @@ - id, valid, create_time, creator_id, updater_id, update_time, version, status, inter_code, task_code, 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 + 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 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 3c467da..7c9d21d 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 @@ -14,6 +14,7 @@ + @@ -32,7 +33,9 @@ - id, valid, create_time, creator_id, updater_id, update_time, version, status, inter_code, task_code, 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 + 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 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 7f9168c..ab2f690 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 @@ -65,11 +65,11 @@ public class ApmsController extends BaseController { } @PostMapping(value = "apmsVoidOrder") - @ApiOperation(value = "APMS作废订单") + @ApiOperation(value = "APMS通知WMS作废订单") public R apmsVoidOrder(@Validated @RequestBody String idenCardNum) { CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); - communicationLog.setLogName("APMS作废订单"); + communicationLog.setLogName("APMS通知WMS作废订单"); communicationLog.setType(3); communicationLog.setContent(idenCardNum); setCommonField(communicationLog); @@ -91,6 +91,31 @@ public class ApmsController extends BaseController { return orderInfoService.apmsCompleteOrder(apmsCompleteOrder); } + + /** + * 通过生产单编号删除生产单,如果生产单加工完成,不允许删除 + * + * @param sheetNo 生产单编号 + * @return + */ + @PostMapping(value = "deleteBySheetNo") + @ApiOperation(value = "通知APMS删除生产单") + public R deleteBySheetNo(@Validated @RequestBody String sheetNo) { + checkToken(); + HashMap paramMap = new HashMap<>(); + paramMap.put("sheetNo", sheetNo); + HttpResponse response = HttpUtil.createGet(ApiAddress + "/platform/api/deleteBySheetNo") + .header("token", Token).form(paramMap).execute(); + CommunicationLog communicationLog = new CommunicationLog(); + communicationLog.setCode("APMS" + System.currentTimeMillis()); + communicationLog.setLogName("WMS通知APMS删除生产单"); + communicationLog.setType(2); + communicationLog.setContent("param:" + paramMap + "\nresult:" + response.body()); + setCommonField(communicationLog); + communicationLogServiceBiz.save(communicationLog); + return successful(JSONUtil.toBean(response.body(), ApmsEndProcessVo.class)); + } + @PostMapping(value = "createProcessSheet") @ApiOperation(value = "通知APMS创建生产单接口") public R createProcessSheet(@Validated @RequestBody ApmsCreateProcessSheet apmsCreateProcess) { @@ -191,7 +216,7 @@ public class ApmsController extends BaseController { .header("token", Token).form(paramMap).execute(); CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); - communicationLog.setLogName("APMS通过车间编码获取炉号信息"); + communicationLog.setLogName("WMS通过APMS使用车间编码获取炉号信息"); communicationLog.setType(2); communicationLog.setContent("param:" + paramMap + "\nresult:" + response.body()); setCommonField(communicationLog); 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 f69eabc..813a103 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 @@ -38,7 +38,7 @@ public class CurrTaskController extends BaseController { @PostMapping(value = "createProcessTask") @ApiOperation(value = "创建一个加工任务至任务队列") - public R createProcessTask(@Validated @RequestBody TaskCreateParam param) { + public R createProcessTask(@Validated @RequestBody TaskCreateParam param) { R mainTask = currTaskService.createProcessTask(param); currTaskDetService.createProcessTaskDet(param.getDetParams(), mainTask.getData().getId()); return successful("创建成功。"); @@ -53,7 +53,13 @@ public class CurrTaskController extends BaseController { @PostMapping(value = "completeTask") @ApiOperation(value = "完成执行任务") - public R completeTask(@Validated @RequestBody IdParam param) { + public R completeTask(@Validated @RequestBody IdParam param) { return currTaskService.completeTask(param); } + + @PostMapping(value = "deleteBySheetNo") + @ApiOperation(value = "通过生产单编号删除生产单(APMS)") + public R deleteBySheetNo(@Validated @RequestBody String sheetNo) { + return currTaskService.deleteBySheetNo(sheetNo); + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java index c691eb6..1f484e4 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java @@ -58,4 +58,12 @@ public interface CurrTaskDetService { * @return 结果 */ List getTaskDetailsByIdenCardNum(String idenCardNum); + + /** + * 查询某个标识卡号的详细任务列表 + * + * @param currTaskId 生产单号 + * @return 结果 + */ + R deleteByCurrTaskId(Long currTaskId); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java index 4f1ccec..8ce07f6 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java @@ -49,4 +49,12 @@ public interface CurrTaskService { * @return 结果 */ R completeTask(IdParam param); + + /** + * 通过生产单编号删除生产单 + * + * @param sheetNo 生产单号 + * @return 结果 + */ + R deleteBySheetNo(String sheetNo); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java index 9bbd583..a752f3c 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java @@ -79,4 +79,10 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe .eq(CurrTaskDet.VALID, 1); return currTaskDetServiceBiz.list(queryWrapper); } + + @Override + public R deleteByCurrTaskId(Long currTaskId) { + currTaskDetServiceBiz.remove(new QueryWrapper().eq(CurrTaskDet.CURR_TASK_ID, currTaskId)); + return successful("成功。"); + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java index 2073ed8..6ca8d49 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java @@ -12,6 +12,7 @@ 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.controller.ApmsController; import com.mt.wms.empty.enums.TaskTypeEnum; import com.mt.wms.empty.params.CurrTaskQueryParam; import com.mt.wms.empty.params.TaskCreateParam; @@ -19,6 +20,7 @@ import com.mt.wms.empty.service.CurrTaskDetService; import com.mt.wms.empty.service.CurrTaskService; import com.mt.wms.empty.service.TaskDetHisService; import com.mt.wms.empty.service.TaskHisService; +import com.mt.wms.empty.vo.ApmsEndProcessVo; import com.mt.wms.empty.vo.CurrTaskQueryVo; import com.mt.wms.empty.vo.CurrTaskVo; import org.apache.commons.lang.StringUtils; @@ -52,6 +54,9 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService @Autowired TaskDetHisService taskDetHisService; + @Autowired + ApmsController apmsControl; + @Override public CurrTaskVo getCurrTask(IdParam idParam) { CurrTask byId = currTaskServiceBiz.getById(idParam.getId()); @@ -99,4 +104,27 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService taskDetHisService.saveList(taskDetHis); return successful("执行成功。"); } + + @Override + public R deleteBySheetNo(String sheetNo) { + CurrTask byId = currTaskServiceBiz.getById(new QueryWrapper().eq(CurrTask.SHEET_NO, sheetNo)); + //如果尚未执行(状态 0) + if (byId.getStatus() == 0) + { + + R apmsStartProcessR = apmsControl.deleteBySheetNo(sheetNo); + if (apmsStartProcessR.getData().getSuccess()) + { + currTaskServiceBiz.removeById(byId.getId()); + currTaskDetService.deleteByCurrTaskId(byId.getId()); + return successful("APMS生产单删除成功。"); + } + else + { + return failed(apmsStartProcessR.getData().getMsg()); + } + } + return failed("无法删除,任务正在执行中。"); + + } } From 37a7a69861f367400370ed254b6e319e2dcbc48a Mon Sep 17 00:00:00 2001 From: Lin-XCC <754310653@QQ.COM> Date: Tue, 30 Nov 2021 16:03:21 +0800 Subject: [PATCH 05/15] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96=20?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E6=B7=BB=E5=8A=A0=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=8A=A0=E5=B7=A5=E6=95=B0=E9=87=8F=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../empty/controller/CurrTaskController.java | 2 +- .../empty/controller/OrderInfoController.java | 13 +++-- .../mt/wms/empty/params/TaskCreateParam.java | 2 +- .../wms/empty/service/CurrTaskDetService.java | 9 ++++ .../mt/wms/empty/service/CurrTaskService.java | 2 +- .../wms/empty/service/TaskDetHisService.java | 9 ++++ .../service/impl/CurrTaskDetServiceImpl.java | 36 +++++++++++-- .../service/impl/CurrTaskServiceImpl.java | 4 +- .../service/impl/OrderInfoServiceImpl.java | 21 ++++++-- .../service/impl/TaskDetHisServiceImpl.java | 37 +++++++++++-- .../java/com/mt/wms/empty/vo/CurrTaskVo.java | 14 +++++ .../java/com/mt/wms/empty/vo/OrderInfoVo.java | 54 +++++++++++++++---- 12 files changed, 171 insertions(+), 32 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 813a103..88d5168 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 @@ -46,7 +46,7 @@ public class CurrTaskController extends BaseController { @PostMapping(value = "currentTaskNow") - @ApiOperation(value = "获取当前执行的任务") + @ApiOperation(value = "获取当前执行的任务 (车辆名称传id)") public R> currentTask(@Validated @RequestBody CurrTaskQueryParam param) { return currTaskService.currentTaskPage(param); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoController.java index 9bf5d8a..8e296df 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoController.java @@ -40,11 +40,16 @@ public class OrderInfoController extends BaseController { return orderInfoService.page(orderBaseParam); } + /** + * 应该没有人工创建信息这个接口 + */ @PostMapping(value = "personCreateOrder") @ApiOperation(value = "人工创建订单信息") - private R personCreateOrder(@Validated({Default.class}) @RequestBody OrderInfoPersonCreateParam orderInfoPersonCreateParam) { + @Deprecated + private R personCreateOrder(@Validated({Default.class}) @RequestBody OrderInfoPersonCreateParam orderInfoPersonCreateParam) { return orderInfoService.personCreateOrder(orderInfoPersonCreateParam); } + @PostMapping(value = "get") @ApiOperation(value = "当前订单查看详情") private R get(@Validated @RequestBody IdParam idParam) { @@ -66,13 +71,15 @@ public class OrderInfoController extends BaseController { @PostMapping(value = "completeOrder") @ApiOperation(value = "完成订单") - private R completeOrder(@Validated @RequestBody IdParam idParam) { + @Deprecated + private R completeOrder(@Validated @RequestBody IdParam idParam) { return orderInfoService.completeOrder(idParam); } @PostMapping(value = "voidOrder") @ApiOperation(value = "作废订单") - private R voidOrder(@Validated @RequestBody IdParam idParam) { + @Deprecated + private R voidOrder(@Validated @RequestBody IdParam idParam) { return orderInfoService.voidOrder(idParam); } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java index b529af1..4118168 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java @@ -28,7 +28,7 @@ public class TaskCreateParam extends BaseParam { private String startPosition; @ApiModelProperty(value = "终点位置", required = true) private String targetPosition; - @ApiModelProperty(value = "加工任务类型", required = true) + @ApiModelProperty(value = "加工类型:0 初始加工,1 复加工 ,2 追加加工", required = true) private Integer processType; @ApiModelProperty(value = "窑炉Id", required = true) private Long kilnId; diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java index 1f484e4..cd13fa6 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java @@ -10,6 +10,7 @@ import com.mt.wms.empty.params.TaskCreateDetParam; import com.mt.wms.empty.vo.CurrTaskDetVo; import com.mt.wms.empty.vo.OrderInfoTaskDetVo; +import java.util.HashMap; import java.util.List; /** @@ -66,4 +67,12 @@ public interface CurrTaskDetService { * @return 结果 */ R deleteByCurrTaskId(Long currTaskId); + + /** + * 通过标识卡号查询订单统计数 + * + * @param idCard 任务详情历史 + * @return 结果 + */ + HashMap getSumByIdCard(String idCard); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java index 8ce07f6..a1343e3 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java @@ -43,7 +43,7 @@ public interface CurrTaskService { R> currentTaskPage(CurrTaskQueryParam param); /** - * 完成执行任务 + * 完成执行任务 不会物理删除,会将删除值置为0,同时在历史表复制一份记录 方便在订单未完成时查询任务详情 * * @param param id * @return 结果 diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskDetHisService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskDetHisService.java index 3d31a8c..f7e31ba 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskDetHisService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskDetHisService.java @@ -6,6 +6,7 @@ import com.mt.wms.core.vo.R; import com.mt.wms.empty.params.OrderInfoTaskDetParam; import com.mt.wms.empty.vo.OrderInfoTaskDetVo; +import java.util.HashMap; import java.util.List; /** @@ -39,4 +40,12 @@ public interface TaskDetHisService { * @return 结果 */ PageVo getHisOrderHisTask(OrderInfoTaskDetParam param); + + /** + * 通过标识卡号查询订单统计数 + * + * @param idCard 任务详情历史 + * @return 结果 + */ + HashMap getSumByIdCard(String idCard); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java index a752f3c..a696a5d 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java @@ -13,12 +13,15 @@ import com.mt.wms.empty.params.CurrTaskDetQueryParam; import com.mt.wms.empty.params.OrderInfoTaskDetParam; import com.mt.wms.empty.params.TaskCreateDetParam; import com.mt.wms.empty.service.CurrTaskDetService; +import com.mt.wms.empty.service.CurrTaskService; import com.mt.wms.empty.vo.CurrTaskDetVo; +import com.mt.wms.empty.vo.CurrTaskVo; import com.mt.wms.empty.vo.OrderInfoTaskDetVo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.HashMap; import java.util.List; /** @@ -34,15 +37,17 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe @Autowired CurrTaskDetServiceBiz currTaskDetServiceBiz; + @Autowired + CurrTaskService currTaskService; @Override public PageVo getCurrOrderCurrTask(OrderInfoTaskDetParam param) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq(CurrTaskDet.IDEN_CARD_NUM,param.getIdenCardNum()) - .eq(CurrTaskDet.ORDER_NO,param.getOrderNo()) - .eq(CurrTaskDet.VALID,1); + queryWrapper.eq(CurrTaskDet.IDEN_CARD_NUM, param.getIdenCardNum()) + .eq(CurrTaskDet.ORDER_NO, param.getOrderNo()) + .eq(CurrTaskDet.VALID, 1); Page page = currTaskDetServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), queryWrapper); - return new PageVo<>(page, OrderInfoTaskDetVo.class); + return new PageVo<>(page, OrderInfoTaskDetVo.class); } @Override @@ -85,4 +90,27 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe currTaskDetServiceBiz.remove(new QueryWrapper().eq(CurrTaskDet.CURR_TASK_ID, currTaskId)); return successful("成功。"); } + + @Override + public HashMap getSumByIdCard(String idCard) { + HashMap result = new HashMap<>(2); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(CurrTaskDet.IDEN_CARD_NUM, idCard) + .eq(CurrTaskDet.VALID, 1); + List list = currTaskDetServiceBiz.list(queryWrapper); + list.forEach(e -> { + CurrTaskVo byId = currTaskService.getCurrTask(IdParam.builder().id(e.getCurrTaskId()).build()); + //如果加工类型是复加工,或者任务作废。移除对象 + if (byId.getProcessType().equals(2) || byId.getValid() != 1) + { + list.remove(e); + } + }); + //计算加工总数 + double sumWeight = list.stream().mapToDouble(CurrTaskDet::getWeight).sum(); + double sumQuantity = list.stream().mapToDouble(CurrTaskDet::getQuantity).sum(); + result.put("weight", sumWeight); + result.put("quantity", sumQuantity); + return result; + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java index 6ca8d49..a678ba0 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java @@ -94,7 +94,9 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService taskHis.setId(null); //将主任务放入到历史表,清空id,防止重复 R save = taskHisService.save(taskHis); - currTaskServiceBiz.removeById(byId.getId()); + byId.setValid(0); + byId.setStatus(2); + currTaskServiceBiz.updateById(byId); List taskDetailsByMainId = currTaskDetService.getTaskDetailsByMainId(IdParam.builder().id(byId.getId()).build()); List taskDetHis = com.mt.wms.core.utils.BeanUtils.copyList(taskDetailsByMainId, TaskDetHis.class); taskDetHis.forEach(detHis -> { 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 9943af0..a6ed68e 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 @@ -23,10 +23,7 @@ import com.mt.wms.core.vo.R; import com.mt.wms.empty.controller.ApmsController; import com.mt.wms.empty.enums.OrderSourceEnum; import com.mt.wms.empty.params.*; -import com.mt.wms.empty.service.CurrTaskDetService; -import com.mt.wms.empty.service.CurrTaskService; -import com.mt.wms.empty.service.OrderInfoHisService; -import com.mt.wms.empty.service.OrderInfoService; +import com.mt.wms.empty.service.*; import com.mt.wms.empty.vo.CurrTaskVo; import com.mt.wms.empty.vo.OrderInfoTaskDetVo; import com.mt.wms.empty.vo.OrderInfoVo; @@ -37,6 +34,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.time.LocalDateTime; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -60,6 +58,8 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic @Autowired CurrTaskDetService currTaskDetService; @Autowired + TaskDetHisService taskDetHisService; + @Autowired CurrTaskService currTaskService; @Autowired KilnInfoService kilnInfoService; @@ -165,10 +165,21 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic @Override public R getTaskInfoByIdenCardNum(String idenCardNum) { QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(OrderInfo.IDEN_CARD_NUM, idenCardNum).eq(OrderInfo.VALID, 1).eq(OrderInfo.STATUS, 0); + wrapper.eq(OrderInfo.IDEN_CARD_NUM, idenCardNum).eq(OrderInfo.VALID, 1); OrderInfo one = orderInfoService.getOne(wrapper); OrderInfoVo build = OrderInfoVo.builder().build(); BeanUtils.copyProperties(one, build); + //查询历史任务表,当前任务表,拉取加工完成 创建任务未加工 计算剩余数量 + HashMap sumCurrTask = currTaskDetService.getSumByIdCard(idenCardNum); + build.setWaitQuantity(sumCurrTask.get("quantity").floatValue()); + build.setWaitWeight(sumCurrTask.get("weight").floatValue()); + + HashMap sumTaskHis = taskDetHisService.getSumByIdCard(idenCardNum); + build.setFinishQuantity(sumTaskHis.get("quantity").floatValue()); + build.setFinishWeight(sumTaskHis.get("weight").floatValue()); + + build.setLastQuantity(build.getQuantity() - build.getFinishQuantity() - build.getWaitQuantity()); + build.setLastWeight(build.getWeight() - build.getFinishWeight() - build.getWaitWeight()); return successful(build); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java index b234718..5d9fbf2 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java @@ -3,18 +3,21 @@ package com.mt.wms.empty.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.mt.wms.core.base.BaseService; -import com.mt.wms.core.dal.entity.CurrTaskDet; import com.mt.wms.core.dal.entity.TaskDetHis; import com.mt.wms.core.dal.service.TaskDetHisServiceBiz; +import com.mt.wms.core.params.IdParam; import com.mt.wms.core.vo.PageVo; import com.mt.wms.core.vo.R; import com.mt.wms.empty.params.OrderInfoTaskDetParam; import com.mt.wms.empty.service.TaskDetHisService; +import com.mt.wms.empty.service.TaskHisService; +import com.mt.wms.empty.vo.CurrTaskVo; import com.mt.wms.empty.vo.OrderInfoTaskDetVo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.HashMap; import java.util.List; /** @@ -30,7 +33,8 @@ public class TaskDetHisServiceImpl extends BaseService implements TaskDetHisServ @Autowired TaskDetHisServiceBiz taskDetHisServiceBiz; - + @Autowired + TaskHisService taskhisService; @Override public R save(TaskDetHis taskDetHis) { @@ -47,10 +51,33 @@ public class TaskDetHisServiceImpl extends BaseService implements TaskDetHisServ @Override public PageVo getHisOrderHisTask(OrderInfoTaskDetParam param) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq(CurrTaskDet.IDEN_CARD_NUM, param.getIdenCardNum()) - .eq(CurrTaskDet.ORDER_NO, param.getOrderNo()) - .eq(CurrTaskDet.VALID, 1); + queryWrapper.eq(TaskDetHis.IDEN_CARD_NUM, param.getIdenCardNum()) + .eq(TaskDetHis.ORDER_NO, param.getOrderNo()) + .eq(TaskDetHis.VALID, 1); Page page = taskDetHisServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), queryWrapper); return new PageVo<>(page, OrderInfoTaskDetVo.class); } + + @Override + public HashMap getSumByIdCard(String idCard) { + HashMap result = new HashMap<>(2); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(TaskDetHis.IDEN_CARD_NUM, idCard) + .eq(TaskDetHis.VALID, 1); + List list = taskDetHisServiceBiz.list(queryWrapper); + list.forEach(e -> { + CurrTaskVo byId = taskhisService.getById(IdParam.builder().id(e.getTaskId()).build()); + //如果加工类型是复加工,或者任务作废。移除对象 + if (byId.getProcessType().equals(2) || byId.getValid() != 1) + { + list.remove(e); + } + }); + //计算加工总数 + double sumWeight = list.stream().mapToDouble(TaskDetHis::getWeight).sum(); + double sumQuantity = list.stream().mapToDouble(TaskDetHis::getQuantity).sum(); + result.put("weight", sumWeight); + result.put("quantity", sumQuantity); + return result; + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskVo.java index a47c415..5b9419a 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskVo.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskVo.java @@ -25,6 +25,14 @@ import java.time.LocalDateTime; public class CurrTaskVo extends BaseVo implements PageVo.ConvertVo { @ApiModelProperty(value = "id") private Long id; + + /** + * 删除标志,是否有效:1 可用 0不可用,2停止 + */ + @ApiModelProperty("删除标志") + private Integer valid; + + /** * 状态: 0等待执行,1执行中,2执行完成,3追加后完成(追加后就按完成来算) */ @@ -55,6 +63,12 @@ public class CurrTaskVo extends BaseVo implements PageVo.ConvertVo { @ApiModelProperty("任务类型") private Integer taskType; + /** + * 加工类型:0 初始加工,1 复加工 ,2 追加加工 + */ + @ApiModelProperty("任务类型") + private Integer processType; + /** * 托盘编码 */ diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java index b6e110b..e887ce3 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java @@ -1,8 +1,6 @@ package com.mt.wms.empty.vo; -import com.baomidou.mybatisplus.annotation.*; import com.mt.wms.core.base.BaseVo; -import com.mt.wms.core.base.ITree; import com.mt.wms.core.vo.PageVo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -11,9 +9,7 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; -import javax.validation.constraints.NotNull; import java.time.LocalDateTime; -import java.util.List; /** * @@ -32,6 +28,12 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo { */ @ApiModelProperty(value = "主键") private Long id; + /** + * 删除标志,是否有效:1 可用 0不可用,2停止 + */ + @ApiModelProperty("删除标志") + private Integer valid; + /** * 来源:1.APMS 2.人工输入 */ @@ -65,13 +67,6 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo { */ @ApiModelProperty(value = "状态") private Integer status; - - /** - * 内部编码,系统自动生成 - */ - @ApiModelProperty(value = "内部编码") - private String interCode; - /** * 编码 */ @@ -143,4 +138,41 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo { */ @ApiModelProperty(value = "数量") private Float quantity; + + /** + * 重量 + */ + @ApiModelProperty(value = "完成加工重量") + private Float finishWeight; + + /** + * 数量 + */ + @ApiModelProperty(value = "完成加工数量") + private Float finishQuantity; + + /** + * 待加工重量 任务创建等待中 + */ + @ApiModelProperty(value = "等待重量") + private Float waitWeight; + + /** + * 待加工数量 任务创建等待中 + */ + @ApiModelProperty(value = "等待数量") + private Float waitQuantity; + + /** + * 剩余重量 完全未处理 + */ + @ApiModelProperty(value = "剩余重量") + private Float lastWeight; + + /** + * 剩余数量 完全未处理 + */ + @ApiModelProperty(value = "剩余数量") + private Float lastQuantity; + } From 4ddb2b35fb5196ab4d40cfda3d47a05c0f043e5c Mon Sep 17 00:00:00 2001 From: Lin-XCC <754310653@QQ.COM> Date: Fri, 3 Dec 2021 10:06:11 +0800 Subject: [PATCH 06/15] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E7=BB=86=E8=8A=82?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=8E=A5=E5=8F=A3=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../empty/controller/CurrTaskController.java | 13 ++-- .../controller/CurrTaskDetController.java | 7 +- .../empty/controller/OrderInfoController.java | 10 +-- .../controller/OrderInfoHisController.java | 8 +-- .../controller/TaskDetHisController.java | 17 ++++- .../empty/controller/TaskHisController.java | 18 ++++- .../wms/empty/params/CurrTaskQueryParam.java | 2 - .../empty/params/OrderInfoBasePageParam.java | 5 +- .../wms/empty/params/TaskHisQueryParam.java | 31 +++++++++ .../wms/empty/service/CurrTaskDetService.java | 2 +- .../wms/empty/service/OrderInfoService.java | 9 +++ .../wms/empty/service/TaskDetHisService.java | 10 +++ .../mt/wms/empty/service/TaskHisService.java | 12 ++++ .../service/impl/CurrTaskServiceImpl.java | 2 + .../service/impl/OrderInfoServiceImpl.java | 12 ++++ .../service/impl/TaskDetHisServiceImpl.java | 11 +++ .../service/impl/TaskHisServiceImpl.java | 18 +++++ .../com/mt/wms/empty/vo/TaskHisDetVo.java | 60 ++++++++++++++++ .../com/mt/wms/empty/vo/TaskHisQueryVo.java | 69 +++++++++++++++++++ 19 files changed, 291 insertions(+), 25 deletions(-) create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskHisQueryParam.java create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisDetVo.java create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisQueryVo.java 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 88d5168..023943f 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 @@ -10,6 +10,7 @@ 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.CurrTaskQueryVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -35,13 +36,17 @@ public class CurrTaskController extends BaseController { private CurrTaskService currTaskService; @Autowired private CurrTaskDetService currTaskDetService; + @Autowired + private OrderInfoService orderInfoService; @PostMapping(value = "createProcessTask") - @ApiOperation(value = "创建一个加工任务至任务队列") + @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("创建成功。"); + return successful("创建成功,任务添加至等待执行队列。"); } @@ -52,13 +57,13 @@ public class CurrTaskController extends BaseController { } @PostMapping(value = "completeTask") - @ApiOperation(value = "完成执行任务") + @ApiOperation(value = "执行任务完成(仅wms,不通知apms)") public R completeTask(@Validated @RequestBody IdParam param) { return currTaskService.completeTask(param); } @PostMapping(value = "deleteBySheetNo") - @ApiOperation(value = "通过生产单编号删除生产单(APMS)") + @ApiOperation(value = "人工通过生产单编号删除未正式开始的生产单(通知APMS)") public R deleteBySheetNo(@Validated @RequestBody String sheetNo) { return currTaskService.deleteBySheetNo(sheetNo); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskDetController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskDetController.java index 86b77eb..65ada3e 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskDetController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/CurrTaskDetController.java @@ -12,7 +12,10 @@ import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** * @author xcc @@ -28,7 +31,7 @@ public class CurrTaskDetController extends BaseController { CurrTaskDetService currTaskDetService; @PostMapping(value = "getTaskDet") - @ApiOperation(value = "查看主任务的详情任务列表") + @ApiOperation(value = "当前执行任务-查看详情") public R> getTaskDetailsPage(@Validated@RequestBody CurrTaskDetQueryParam currTaskId){ return currTaskDetService.getTaskDetailsPage(currTaskId); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoController.java index 8e296df..750395f 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoController.java @@ -35,7 +35,7 @@ public class OrderInfoController extends BaseController { private OrderInfoService orderInfoService; @PostMapping(value = "page") - @ApiOperation(value = "获取分页订单基础信息") + @ApiOperation(value = "订单加工管理-获取分页订单信息") private R> page(@Validated({PageGroup.class, Default.class}) @RequestBody OrderInfoBasePageParam orderBaseParam) { return orderInfoService.page(orderBaseParam); } @@ -50,20 +50,20 @@ public class OrderInfoController extends BaseController { return orderInfoService.personCreateOrder(orderInfoPersonCreateParam); } - @PostMapping(value = "get") - @ApiOperation(value = "当前订单查看详情") + @PostMapping(value = "getDet") + @ApiOperation(value = "当前订单列表-查看详情") private R get(@Validated @RequestBody IdParam idParam) { return orderInfoService.getOne(idParam); } @PostMapping(value = "getTaskInfo") - @ApiOperation(value = "当前订单任务详情") + @ApiOperation(value = "当前订单列表-查看任务详情") private R> getTaskInfo(@Validated @RequestBody OrderInfoTaskDetParam orderInfoTaskDetParam) { return orderInfoService.getTaskInfo(orderInfoTaskDetParam); } @GetMapping(value = "getTaskInfoByIdenCardNum") - @ApiOperation(value = "根据标识卡获取信息") + @ApiOperation(value = "订单加工-填写时根据标识卡获取信息") private R getTaskInfoByIdenCardNum(@Validated @RequestParam String idenCardNum) { return orderInfoService.getTaskInfoByIdenCardNum(idenCardNum); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoHisController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoHisController.java index ac91c41..f0cd79e 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoHisController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoHisController.java @@ -37,19 +37,19 @@ public class OrderInfoHisController extends BaseController { private OrderInfoHisService orderInfoHisService; @PostMapping(value = "page") - @ApiOperation(value = "获取分页订单基础信息") + @ApiOperation(value = "获取分页订单历史信息") private R> page(@Validated({PageGroup.class, Default.class}) @RequestBody OrderInfoBasePageParam orderBaseParam) { return orderInfoHisService.page(orderBaseParam); } - @PostMapping(value = "get") - @ApiOperation(value = "订单历史查看详情") + @PostMapping(value = "getDet") + @ApiOperation(value = "订单历史-查看详情") private R get(@Validated @RequestBody IdParam idParam) { return orderInfoHisService.getOne(idParam); } @PostMapping(value = "getTaskInfo") - @ApiOperation(value = "订单历史任务详情") + @ApiOperation(value = "订单历史-查看任务详情") private R> getTaskInfo(@Validated @RequestBody OrderInfoTaskDetParam orderInfoTaskDetParam) { return orderInfoHisService.getTaskInfo(orderInfoTaskDetParam); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskDetHisController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskDetHisController.java index 479b30d..902844d 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskDetHisController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskDetHisController.java @@ -2,10 +2,18 @@ package com.mt.wms.empty.controller; import com.mt.wms.core.base.BaseController; import com.mt.wms.core.constants.CommonConstant; -import com.mt.wms.empty.service.CurrTaskDetService; +import com.mt.wms.core.vo.PageVo; +import com.mt.wms.core.vo.R; +import com.mt.wms.empty.params.CurrTaskDetQueryParam; +import com.mt.wms.empty.service.TaskDetHisService; +import com.mt.wms.empty.vo.TaskHisDetVo; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -20,6 +28,11 @@ import org.springframework.web.bind.annotation.RestController; @Api(value = "任务详情历史", tags = "任务详情历史管理", hidden = false) public class TaskDetHisController extends BaseController { @Autowired - CurrTaskDetService currTaskDetService; + TaskDetHisService taskDetHisService; + @PostMapping(value = "getTaskDet") + @ApiOperation(value = "历史执行任务-查看详情") + public R> getTaskDetailsPage(@Validated @RequestBody CurrTaskDetQueryParam currTaskId) { + return taskDetHisService.getTaskDetailsPage(currTaskId); + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskHisController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskHisController.java index 02a66a1..2194755 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskHisController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskHisController.java @@ -2,10 +2,18 @@ package com.mt.wms.empty.controller; import com.mt.wms.core.base.BaseController; import com.mt.wms.core.constants.CommonConstant; -import com.mt.wms.empty.service.CurrTaskService; +import com.mt.wms.core.vo.PageVo; +import com.mt.wms.core.vo.R; +import com.mt.wms.empty.params.TaskHisQueryParam; +import com.mt.wms.empty.service.TaskHisService; +import com.mt.wms.empty.vo.TaskHisQueryVo; import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -20,5 +28,11 @@ import org.springframework.web.bind.annotation.RestController; @Api(value = "任务历史管理", tags = "任务历史管理", hidden = false) public class TaskHisController extends BaseController { @Autowired - private CurrTaskService currTaskService; + private TaskHisService taskHisService; + + @PostMapping(value = "taskHis") + @ApiOperation(value = "获取历史执行的任务 (车辆名称传id)") + public R> currentTask(@Validated @RequestBody TaskHisQueryParam param) { + return taskHisService.taskHisPage(param); + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskQueryParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskQueryParam.java index b9d1445..a614906 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskQueryParam.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskQueryParam.java @@ -20,8 +20,6 @@ public class CurrTaskQueryParam extends BasePageParam { private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "标识卡号",required = false) - private String idenCardNum; @ApiModelProperty(value = "车辆id") private String vehicleId; diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/OrderInfoBasePageParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/OrderInfoBasePageParam.java index 40e22bc..329aacb 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/OrderInfoBasePageParam.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/OrderInfoBasePageParam.java @@ -1,6 +1,5 @@ package com.mt.wms.empty.params; -import com.mt.wms.core.base.BaseParam; import com.mt.wms.core.params.BasePageParam; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @@ -24,13 +23,13 @@ public class OrderInfoBasePageParam extends BasePageParam { /** * 订单号,APMS系统获取 */ - @ApiModelProperty(value = "订单号", required = false) + @ApiModelProperty(value = "订单号", required = true) private String orderNo; /** * 标识卡号,APMS系统获取 */ - @ApiModelProperty(value = "标识卡号", required = false) + @ApiModelProperty(value = "标识卡号", required = true) private String idenCardNum; diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskHisQueryParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskHisQueryParam.java new file mode 100644 index 0000000..1fc02db --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskHisQueryParam.java @@ -0,0 +1,31 @@ +package com.mt.wms.empty.params; + +import com.mt.wms.core.params.BasePageParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * @author xcc + * @date 2021年11月9日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "获取任务信息", description = "获取任务信息") +public class TaskHisQueryParam extends BasePageParam { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "车辆id") + private String vehicleId; + @ApiModelProperty(value = "开始时间") + private LocalDateTime startTime; + @ApiModelProperty(value = "开始时间") + private LocalDateTime endTime; +} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java index cd13fa6..cdf876d 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskDetService.java @@ -61,7 +61,7 @@ public interface CurrTaskDetService { List getTaskDetailsByIdenCardNum(String idenCardNum); /** - * 查询某个标识卡号的详细任务列表 + * 通过生产单删除某个生产单 * * @param currTaskId 生产单号 * @return 结果 diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/OrderInfoService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/OrderInfoService.java index ca8a3c1..209e246 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/OrderInfoService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/OrderInfoService.java @@ -7,6 +7,8 @@ import com.mt.wms.empty.params.*; import com.mt.wms.empty.vo.OrderInfoTaskDetVo; import com.mt.wms.empty.vo.OrderInfoVo; +import java.util.List; + /** * 订单相关服务 * @@ -61,6 +63,13 @@ public interface OrderInfoService { */ R getTaskInfoByIdenCardNum(String idenCardNum); + /** + * 验证传入的详细订单标识卡正确 + * + * @param detParams 详细订单 + */ + void verifyTaskInfoByIdenCardNum(List detParams); + /** * 完成订单 * diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskDetHisService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskDetHisService.java index f7e31ba..865f953 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskDetHisService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskDetHisService.java @@ -3,8 +3,10 @@ package com.mt.wms.empty.service; import com.mt.wms.core.dal.entity.TaskDetHis; import com.mt.wms.core.vo.PageVo; import com.mt.wms.core.vo.R; +import com.mt.wms.empty.params.CurrTaskDetQueryParam; import com.mt.wms.empty.params.OrderInfoTaskDetParam; import com.mt.wms.empty.vo.OrderInfoTaskDetVo; +import com.mt.wms.empty.vo.TaskHisDetVo; import java.util.HashMap; import java.util.List; @@ -48,4 +50,12 @@ public interface TaskDetHisService { * @return 结果 */ HashMap getSumByIdCard(String idCard); + + /** + * 查询历史加工的详细任务信息 + * + * @param currTaskId 详细任务信息 + * @return 结果 + */ + R> getTaskDetailsPage(CurrTaskDetQueryParam currTaskId); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskHisService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskHisService.java index 98e3cdd..6972169 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskHisService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/TaskHisService.java @@ -3,8 +3,11 @@ package com.mt.wms.empty.service; import com.mt.wms.core.dal.entity.TaskHis; 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.TaskHisQueryParam; import com.mt.wms.empty.vo.CurrTaskVo; +import com.mt.wms.empty.vo.TaskHisQueryVo; /** * 主任务历史相关服务 @@ -30,4 +33,13 @@ public interface TaskHisService { * @return 结果 */ CurrTaskVo getById(IdParam id); + + /** + * 查询分页信息 + * + * @param param 查询参数 + * @return 结果 + */ + R> taskHisPage(TaskHisQueryParam param); + } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java index a678ba0..fa136b6 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java @@ -2,6 +2,7 @@ package com.mt.wms.empty.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.mt.wms.core.api.Assert; import com.mt.wms.core.base.BaseService; import com.mt.wms.core.dal.entity.CurrTask; import com.mt.wms.core.dal.entity.CurrTaskDet; @@ -67,6 +68,7 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService @Override public R createProcessTask(TaskCreateParam param) { + Assert.notNull("错误,加工类型不可为空!", param.getProcessType()); CurrTask currTask = new CurrTask(); BeanUtils.copyProperties(param, currTask); currTask.setTaskType(TaskTypeEnum.WTK.getValue()); 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 a6ed68e..f12de12 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 @@ -167,6 +167,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(OrderInfo.IDEN_CARD_NUM, idenCardNum).eq(OrderInfo.VALID, 1); OrderInfo one = orderInfoService.getOne(wrapper); + Assert.notNull("未找到该标识卡信息!", one); OrderInfoVo build = OrderInfoVo.builder().build(); BeanUtils.copyProperties(one, build); //查询历史任务表,当前任务表,拉取加工完成 创建任务未加工 计算剩余数量 @@ -183,6 +184,17 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic return successful(build); } + @Override + public void verifyTaskInfoByIdenCardNum(List detParams) { + for (TaskCreateDetParam detParam : detParams) + { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(OrderInfo.IDEN_CARD_NUM, detParam.getIdenCardNum()).eq(OrderInfo.VALID, 1); + OrderInfo one = orderInfoService.getOne(wrapper); + Assert.notNull("错误,标识卡号" + detParam.getIdenCardNum() + "在订单中不存在!", one); + } + } + @Override public R completeOrder(IdParam idParam) { OrderInfo byId = orderInfoService.getById(idParam.getId()); diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java index 5d9fbf2..5382a11 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java @@ -8,11 +8,13 @@ import com.mt.wms.core.dal.service.TaskDetHisServiceBiz; import com.mt.wms.core.params.IdParam; import com.mt.wms.core.vo.PageVo; import com.mt.wms.core.vo.R; +import com.mt.wms.empty.params.CurrTaskDetQueryParam; import com.mt.wms.empty.params.OrderInfoTaskDetParam; import com.mt.wms.empty.service.TaskDetHisService; import com.mt.wms.empty.service.TaskHisService; import com.mt.wms.empty.vo.CurrTaskVo; import com.mt.wms.empty.vo.OrderInfoTaskDetVo; +import com.mt.wms.empty.vo.TaskHisDetVo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -80,4 +82,13 @@ public class TaskDetHisServiceImpl extends BaseService implements TaskDetHisServ result.put("quantity", sumQuantity); return result; } + + @Override + public R> getTaskDetailsPage(CurrTaskDetQueryParam currTaskId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(TaskDetHis.TASK_ID, currTaskId.getCurrTaskId()) + .eq(TaskDetHis.VALID, 1); + Page page = taskDetHisServiceBiz.page(new Page<>(currTaskId.getCurrent(), currTaskId.getSize()), queryWrapper); + return successful(new PageVo<>(page, TaskHisDetVo.class)); + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskHisServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskHisServiceImpl.java index 7054466..86643bd 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskHisServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskHisServiceImpl.java @@ -1,18 +1,26 @@ package com.mt.wms.empty.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.mt.wms.core.base.BaseService; import com.mt.wms.core.dal.entity.TaskHis; import com.mt.wms.core.dal.service.TaskHisServiceBiz; 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.TaskHisQueryParam; import com.mt.wms.empty.service.TaskHisService; import com.mt.wms.empty.vo.CurrTaskVo; +import com.mt.wms.empty.vo.TaskHisQueryVo; +import jodd.util.StringUtil; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.Objects; + /** * 服务实现类 * @@ -41,4 +49,14 @@ public class TaskHisServiceImpl extends BaseService implements TaskHisService { BeanUtils.copyProperties(byId, build); return build; } + + @Override + public R> taskHisPage(TaskHisQueryParam param) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(StringUtil.isNotBlank(param.getVehicleId()), TaskHis.VEHICLE_ID, param.getVehicleId()) + .between(Objects.nonNull(param.getStartTime()) && Objects.nonNull(param.getEndTime()), TaskHis.CREATE_TIME, param.getStartTime(), param.getEndTime()) + .eq(TaskHis.VALID, 1).orderByDesc(TaskHis.CREATE_TIME); + Page page = taskHisService.page(new Page<>(param.getCurrent(), param.getSize()), queryWrapper); + return successful(new PageVo<>(page, TaskHisQueryVo.class)); + } } 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 new file mode 100644 index 0000000..ad09f49 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisDetVo.java @@ -0,0 +1,60 @@ +package com.mt.wms.empty.vo; + +import com.mt.wms.core.base.BaseVo; +import com.mt.wms.core.vo.PageVo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * @author xcc + * @date 2021年11月8日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Builder +@ApiModel(value = "任务详细信息", description = "用于返回任务详细信息") +public class TaskHisDetVo extends BaseVo implements PageVo.ConvertVo { + @ApiModelProperty(value = "id") + private Long id; + /** + * 修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同 + */ + @ApiModelProperty("修改时间") + private LocalDateTime updateTime; + + /** + * 状态: 0等待执行 + */ + @ApiModelProperty("状态") + private Integer status; + /** + * 任务编码 + */ + @ApiModelProperty("任务编码") + private String taskCode; + + /** + * 历史任务id,关联当前任务表:t_task_his + */ + @ApiModelProperty("历史任务id") + private Long taskId; + /** + * 重量,手动输入 + */ + @ApiModelProperty("重量") + private Float weight; + + /** + * 数量,手动输入 + */ + @ApiModelProperty("数量") + private Float quantity; +} 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 new file mode 100644 index 0000000..81bd01f --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/TaskHisQueryVo.java @@ -0,0 +1,69 @@ +package com.mt.wms.empty.vo; + +import com.mt.wms.core.base.BaseVo; +import com.mt.wms.core.vo.PageVo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.time.LocalDateTime; + +/** + * @author xcc + * @date 2021年11月8日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Builder +@ApiModel(value = "历史任务信息", description = "历史任务信息") +public class TaskHisQueryVo extends BaseVo implements PageVo.ConvertVo { + @ApiModelProperty(value = "id") + private Long id; + + /** + * 任务编码, 查看任务编码规则 + */ + @ApiModelProperty("任务编码") + private String taskCode; + /** + * 发起任务时间 + */ + @ApiModelProperty("发起时间") + private LocalDateTime createTime; + /** + * 任务来源, 暂时只有人工 + */ + @ApiModelProperty("任务来源") + private String taskSource; + /** + * 状态: 0等待执行,1执行中,2执行完成,3追加后完成(追加后就按完成来算) + */ + @ApiModelProperty("状态") + private Integer status; + /** + * 任务类型:0:入库到窑炉,1:入库到缓存区,2出库到 窑炉到缓存区,3缓存区出库 + */ + @ApiModelProperty("任务类型") + private Integer taskType; + /** + * 开始位置 + */ + @ApiModelProperty("开始位置") + private String startPosition; + + /** + * 目标位置指的是窑炉的位置 + */ + @ApiModelProperty("窑炉位置") + private String targetPosition; + /** + * 车辆名称,关联车辆表:t_vehicle_info + */ + @ApiModelProperty("车辆名称") + private String vehicleName; +} From 5f4b5687f1f239d855154efda30847af004e6516 Mon Sep 17 00:00:00 2001 From: Lin-XCC <754310653@QQ.COM> Date: Tue, 7 Dec 2021 11:01:44 +0800 Subject: [PATCH 07/15] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=B3=A8=E8=A7=A3?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=AF=BC=E8=87=B4=E7=9A=84swagger=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20=E6=B7=BB=E5=8A=A0=E9=A6=96=E9=A1=B5=E7=9A=84?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E4=B8=AD=E4=BB=BB=E5=8A=A1=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=20=E5=B0=86apms=E7=9A=84=E6=8E=A5=E5=8F=A3=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E6=97=A0=E9=9C=80token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/empty/controller/ApmsController.java | 9 ++- .../empty/controller/CurrTaskController.java | 8 ++ .../controller/TaskDetHisController.java | 4 +- .../empty/controller/TaskHisController.java | 11 +++ .../empty/params/ApmsFinishProcessSheet.java | 2 +- .../empty/params/CurrTaskDetQueryParam.java | 3 +- .../wms/empty/params/TaskHisQueryParam.java | 4 +- .../mt/wms/empty/service/CurrTaskService.java | 9 +++ .../service/impl/CurrTaskServiceImpl.java | 44 +++++++++- .../mt/wms/empty/vo/CurrTaskMainQueryVo.java | 80 +++++++++++++++++++ .../src/main/resources/config/application.yml | 1 + 11 files changed, 163 insertions(+), 12 deletions(-) create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskMainQueryVo.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 ab2f690..67e607f 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 @@ -9,6 +9,7 @@ import com.mt.wms.core.base.BaseController; import com.mt.wms.core.constants.CommonConstant; import com.mt.wms.core.dal.entity.CommunicationLog; import com.mt.wms.core.dal.service.CommunicationLogServiceBiz; +import com.mt.wms.core.enums.WhetherEnum; import com.mt.wms.core.vo.R; import com.mt.wms.empty.params.*; import com.mt.wms.empty.service.OrderInfoService; @@ -96,7 +97,7 @@ public class ApmsController extends BaseController { * 通过生产单编号删除生产单,如果生产单加工完成,不允许删除 * * @param sheetNo 生产单编号 - * @return + * @return 删除结果 */ @PostMapping(value = "deleteBySheetNo") @ApiOperation(value = "通知APMS删除生产单") @@ -234,4 +235,10 @@ public class ApmsController extends BaseController { getApmsToken(); } } + + private void setCommonField(CommunicationLog communicationLog) { + communicationLog.setValid(WhetherEnum.YES.getValue()); + communicationLog.setCreateTime(LocalDateTime.now()); + communicationLog.setUpdateTime(LocalDateTime.now()); + } } 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 023943f..a821c5c 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 @@ -2,6 +2,7 @@ package com.mt.wms.empty.controller; import com.mt.wms.core.base.BaseController; import com.mt.wms.core.constants.CommonConstant; +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; @@ -11,6 +12,7 @@ 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.CurrTaskMainQueryVo; import com.mt.wms.empty.vo.CurrTaskQueryVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -50,6 +52,12 @@ public class CurrTaskController extends BaseController { } + @PostMapping(value = "mainCurrentTaskNow") + @ApiOperation(value = "首页-获取当前执行中的任务") + public R> mainCurrentTaskNow(BasePageParam param) { + return currTaskService.currentTaskMainPage(param); + } + @PostMapping(value = "currentTaskNow") @ApiOperation(value = "获取当前执行的任务 (车辆名称传id)") public R> currentTask(@Validated @RequestBody CurrTaskQueryParam param) { diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskDetHisController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskDetHisController.java index 902844d..a429dfe 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskDetHisController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskDetHisController.java @@ -32,7 +32,7 @@ public class TaskDetHisController extends BaseController { @PostMapping(value = "getTaskDet") @ApiOperation(value = "历史执行任务-查看详情") - public R> getTaskDetailsPage(@Validated @RequestBody CurrTaskDetQueryParam currTaskId) { - return taskDetHisService.getTaskDetailsPage(currTaskId); + public R> getTaskDetailsPage(@Validated @RequestBody CurrTaskDetQueryParam param) { + return taskDetHisService.getTaskDetailsPage(param); } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskHisController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskHisController.java index 2194755..6f6f2e5 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskHisController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/TaskHisController.java @@ -2,6 +2,7 @@ package com.mt.wms.empty.controller; import com.mt.wms.core.base.BaseController; import com.mt.wms.core.constants.CommonConstant; +import com.mt.wms.core.utils.LocalDateTimeUtils; import com.mt.wms.core.vo.PageVo; import com.mt.wms.core.vo.R; import com.mt.wms.empty.params.TaskHisQueryParam; @@ -17,6 +18,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.Objects; + /** * @author xcc * @date 2021年11月16日 @@ -33,6 +36,14 @@ public class TaskHisController extends BaseController { @PostMapping(value = "taskHis") @ApiOperation(value = "获取历史执行的任务 (车辆名称传id)") public R> currentTask(@Validated @RequestBody TaskHisQueryParam param) { + if (Objects.nonNull(param.getStartTime())) + { + param.setStartTime(LocalDateTimeUtils.getDayStart(param.getStartTime())); + } + if (Objects.nonNull(param.getEndTime())) + { + param.setEndTime(LocalDateTimeUtils.getDayEnd(param.getEndTime())); + } return taskHisService.taskHisPage(param); } } 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 eb77ea5..131bb3d 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 @@ -13,7 +13,7 @@ import java.util.List; @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) -@ApiModel(value = "Apms创建生产单", description = "Apms创建生产单") +@ApiModel(value = "Apms结束生产单", description = "Apms结束生产单") public class ApmsFinishProcessSheet extends BaseParam { private static final long serialVersionUID = 1L; diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskDetQueryParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskDetQueryParam.java index 7c7801c..5d1250e 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskDetQueryParam.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CurrTaskDetQueryParam.java @@ -15,12 +15,11 @@ import lombok.experimental.Accessors; @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) -@ApiModel(value = "获取任务信息", description = "获取任务信息") +@ApiModel(value = "获取任务详细信息", description = "获取任务详细信息") public class CurrTaskDetQueryParam extends BasePageParam { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "主任务id",required = true) private Long currTaskId; - } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskHisQueryParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskHisQueryParam.java index 1fc02db..bb428f9 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskHisQueryParam.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskHisQueryParam.java @@ -24,8 +24,8 @@ public class TaskHisQueryParam extends BasePageParam { @ApiModelProperty(value = "车辆id") private String vehicleId; - @ApiModelProperty(value = "开始时间") + @ApiModelProperty(value = "开始时间", example = "2021-11-20T12:05:20") private LocalDateTime startTime; - @ApiModelProperty(value = "开始时间") + @ApiModelProperty(value = "结束时间", example = "2021-11-25T12:05:20") private LocalDateTime endTime; } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java index a1343e3..53cd413 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java @@ -1,11 +1,13 @@ package com.mt.wms.empty.service; +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.CurrTaskQueryParam; import com.mt.wms.empty.params.TaskCreateParam; +import com.mt.wms.empty.vo.CurrTaskMainQueryVo; import com.mt.wms.empty.vo.CurrTaskQueryVo; import com.mt.wms.empty.vo.CurrTaskVo; @@ -57,4 +59,11 @@ public interface CurrTaskService { * @return 结果 */ R deleteBySheetNo(String sheetNo); + + /** + * 首页 获取当前执行的任务 + * + * @return 结果 + */ + R> currentTaskMainPage(BasePageParam param); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java index fa136b6..ab7da2e 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java @@ -4,11 +4,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.mt.wms.core.api.Assert; import com.mt.wms.core.base.BaseService; -import com.mt.wms.core.dal.entity.CurrTask; -import com.mt.wms.core.dal.entity.CurrTaskDet; -import com.mt.wms.core.dal.entity.TaskDetHis; -import com.mt.wms.core.dal.entity.TaskHis; +import com.mt.wms.core.dal.entity.*; import com.mt.wms.core.dal.service.CurrTaskServiceBiz; +import com.mt.wms.core.dal.service.OrderInfoServiceBiz; +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; @@ -22,6 +21,7 @@ import com.mt.wms.empty.service.CurrTaskService; import com.mt.wms.empty.service.TaskDetHisService; import com.mt.wms.empty.service.TaskHisService; import com.mt.wms.empty.vo.ApmsEndProcessVo; +import com.mt.wms.empty.vo.CurrTaskMainQueryVo; import com.mt.wms.empty.vo.CurrTaskQueryVo; import com.mt.wms.empty.vo.CurrTaskVo; import org.apache.commons.lang.StringUtils; @@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.List; /** @@ -58,6 +59,9 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService @Autowired ApmsController apmsControl; + @Autowired + OrderInfoServiceBiz orderInfoServiceBiz; + @Override public CurrTaskVo getCurrTask(IdParam idParam) { CurrTask byId = currTaskServiceBiz.getById(idParam.getId()); @@ -131,4 +135,36 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService return failed("无法删除,任务正在执行中。"); } + + @Override + public R> currentTaskMainPage(BasePageParam param) { + QueryWrapper currTaskQueryWrapper = new QueryWrapper<>(); + currTaskQueryWrapper.eq(CurrTask.STATUS, 1); + currTaskQueryWrapper.eq(CurrTask.VALID, 1); + Page page = currTaskServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), currTaskQueryWrapper); + PageVo pageVo = new PageVo<>(page, CurrTaskMainQueryVo.class); + pageVo.getRecords().forEach(e -> + { + //根据当前主任务查详细任务 + List taskDetailsByMainId = currTaskDetService.getTaskDetailsByMainId(IdParam.builder().id(e.getId()).build()); + ArrayList materialDes = new ArrayList<>(); + ArrayList iden = new ArrayList<>(); + //写入材料名与标识卡号 + taskDetailsByMainId.forEach(a -> { + materialDes.add(a.getMaterialDes()); + iden.add(a.getIdenCardNum()); + }); + e.setMaterials(materialDes); + e.setCustomers(iden); + ArrayList customers = new ArrayList<>(); + //根据标识卡号查订单的客户名并写入 + e.getIdens().forEach(id -> { + OrderInfo one = orderInfoServiceBiz.getOne(new QueryWrapper().eq(OrderInfo.IDEN_CARD_NUM, id)); + customers.add(one.getCustomerName()); + } + ); + e.setCustomers(customers); + }); + return successful(pageVo); + } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskMainQueryVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskMainQueryVo.java new file mode 100644 index 0000000..80043c1 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/CurrTaskMainQueryVo.java @@ -0,0 +1,80 @@ +package com.mt.wms.empty.vo; + +import com.mt.wms.core.base.BaseVo; +import com.mt.wms.core.vo.PageVo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.ArrayList; + +/** + * @author xcc + * @date 2021年11月8日 + * @since 1.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Builder +@ApiModel(value = "首页当前任务信息", description = "首页当前任务信息") +public class CurrTaskMainQueryVo extends BaseVo implements PageVo.ConvertVo { + @ApiModelProperty(value = "id") + private Long id; + + /** + * 任务编码, 查看任务编码规则 + */ + @ApiModelProperty("任务编码") + private String taskCode; + /** + * 标识卡集 + */ + @ApiModelProperty("标识卡集") + private ArrayList idens; + /** + * 物料集 材料集? + */ + @ApiModelProperty("物料集") + private ArrayList materials; + /** + * 客户集 + */ + @ApiModelProperty("客户集") + private ArrayList customers; + + /** + * 状态: 0等待执行,1执行中,2执行完成,3追加后完成(追加后就按完成来算) + */ + private Integer status; + + /** + * 任务类型:0:入库到窑炉,1:入库到缓存区,2出库到 窑炉到缓存区,3缓存区出库 + */ + @ApiModelProperty("任务类型") + private Integer taskType; + /** + * 开始位置 + */ + @ApiModelProperty("开始位置") + private String startPosition; + + /** + * 目标位置指的是窑炉的位置 + */ + @ApiModelProperty("窑炉位置") + private String targetPosition; + /** + * 库位 + */ + @ApiModelProperty("库位") + private String locationName; + /** + * 窑炉名称 + */ + @ApiModelProperty("窑炉名称") + private String kilnName; +} diff --git a/6.program/wms-gateway/src/main/resources/config/application.yml b/6.program/wms-gateway/src/main/resources/config/application.yml index 4f5a514..9348986 100644 --- a/6.program/wms-gateway/src/main/resources/config/application.yml +++ b/6.program/wms-gateway/src/main/resources/config/application.yml @@ -88,6 +88,7 @@ wms: - /*/login - /*/wechatLogin - /*/mobileLogin + - /apms #公共配置 common: From 964f9888f5e6e30e11c373c5a6b9764e3075f3f2 Mon Sep 17 00:00:00 2001 From: Lin-XCC <754310653@QQ.COM> Date: Tue, 7 Dec 2021 18:24:00 +0800 Subject: [PATCH 08/15] =?UTF-8?q?=E5=B0=86apms=E7=9A=84=E5=86=85=E9=83=A8?= =?UTF-8?q?=E7=B1=BB=E6=94=B9=E4=B8=BA=E5=A4=96=E9=83=A8=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../empty/params/ApmsCreateProcessSheet.java | 15 ------------ .../empty/params/ApmsFinishProcessSheet.java | 15 ------------ .../com/mt/wms/empty/params/CreateItem.java | 24 +++++++++++++++++++ .../com/mt/wms/empty/params/FinishItem.java | 24 +++++++++++++++++++ 4 files changed, 48 insertions(+), 30 deletions(-) create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CreateItem.java create mode 100644 6.program/wms-empty/src/main/java/com/mt/wms/empty/params/FinishItem.java 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 d7d82f3..77e467c 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 @@ -41,18 +41,3 @@ public class ApmsCreateProcessSheet extends BaseParam { private String workShopCode; } -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "Apms生产单详细", description = "Apms生产单详细") -class CreateItem extends BaseParam { - private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "标识卡号", required = true) - private String itemCode; - - @ApiModelProperty(value = "加工数量", required = true) - private Integer quantity; - - @ApiModelProperty(value = "加工重量", required = true) - 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 131bb3d..a549569 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 @@ -34,18 +34,3 @@ public class ApmsFinishProcessSheet extends BaseParam { private String remark; } -@Data -@EqualsAndHashCode(callSuper = false) -@Accessors(chain = true) -@ApiModel(value = "Apms生产单详细", description = "Apms生产单详细") -class FinishItem extends BaseParam { - private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "标识卡号", required = true) - private String itemCode; - - @ApiModelProperty(value = "完成加工数量", required = true) - private Integer finishQuantity; - - @ApiModelProperty(value = "完成加工重量", required = true) - private Double finishWeight; -} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CreateItem.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CreateItem.java new file mode 100644 index 0000000..4c789d4 --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/CreateItem.java @@ -0,0 +1,24 @@ +package com.mt.wms.empty.params; + +import com.mt.wms.core.base.BaseParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "Apms生产单详细", description = "Apms生产单详细") +public class CreateItem extends BaseParam { + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "标识卡号", required = true) + private String itemCode; + + @ApiModelProperty(value = "加工数量", required = true) + private Integer quantity; + + @ApiModelProperty(value = "加工重量", required = true) + private Double weight; +} diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/FinishItem.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/FinishItem.java new file mode 100644 index 0000000..1b6821f --- /dev/null +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/FinishItem.java @@ -0,0 +1,24 @@ +package com.mt.wms.empty.params; + +import com.mt.wms.core.base.BaseParam; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@ApiModel(value = "Apms生产单详细", description = "Apms生产单详细") +public class FinishItem extends BaseParam { + private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "标识卡号", required = true) + private String itemCode; + + @ApiModelProperty(value = "完成加工数量", required = true) + private Integer finishQuantity; + + @ApiModelProperty(value = "完成加工重量", required = true) + private Double finishWeight; +} From dfb51b08fe2acf6649db73230184a840fc2057a9 Mon Sep 17 00:00:00 2001 From: Lin-XCC <754310653@QQ.COM> Date: Tue, 7 Dec 2021 18:25:45 +0800 Subject: [PATCH 09/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E8=AF=A6=E7=BB=86=E7=9A=84=E8=BF=94=E5=9B=9E=E5=80=BC=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CurrTaskDetServiceImpl.java | 13 ++++++- .../service/impl/CurrTaskServiceImpl.java | 3 +- .../service/impl/TaskDetHisServiceImpl.java | 13 ++++++- .../com/mt/wms/empty/vo/CurrTaskDetVo.java | 33 ++++++++++++++++++ .../com/mt/wms/empty/vo/CurrTaskQueryVo.java | 5 +++ .../com/mt/wms/empty/vo/TaskHisDetVo.java | 34 +++++++++++++++++++ 6 files changed, 98 insertions(+), 3 deletions(-) diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java index a696a5d..c7d1814 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java @@ -4,7 +4,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.mt.wms.core.base.BaseService; import com.mt.wms.core.dal.entity.CurrTaskDet; +import com.mt.wms.core.dal.entity.OrderInfo; import com.mt.wms.core.dal.service.CurrTaskDetServiceBiz; +import com.mt.wms.core.dal.service.OrderInfoServiceBiz; import com.mt.wms.core.params.IdParam; import com.mt.wms.core.utils.BeanUtils; import com.mt.wms.core.vo.PageVo; @@ -39,6 +41,8 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe CurrTaskDetServiceBiz currTaskDetServiceBiz; @Autowired CurrTaskService currTaskService; + @Autowired + OrderInfoServiceBiz orderInfoService; @Override public PageVo getCurrOrderCurrTask(OrderInfoTaskDetParam param) { @@ -66,7 +70,14 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe queryWrapper.eq(CurrTaskDet.CURR_TASK_ID, currTaskId.getCurrTaskId()) .eq(CurrTaskDet.VALID, 1); Page page = currTaskDetServiceBiz.page(new Page<>(currTaskId.getCurrent(), currTaskId.getSize()), queryWrapper); - return successful(new PageVo<>(page, CurrTaskDetVo.class)); + PageVo currTaskDetVo = new PageVo<>(page, CurrTaskDetVo.class); + currTaskDetVo.getRecords().forEach( + e -> { + OrderInfo one = orderInfoService.getOne(new QueryWrapper().eq(OrderInfo.IDEN_CARD_NUM, e.getIdenCardNum())); + e.setProductModel(one.getProductModel()); + } + ); + return successful(currTaskDetVo); } @Override diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java index ab7da2e..242b44c 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java @@ -143,6 +143,7 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService currTaskQueryWrapper.eq(CurrTask.VALID, 1); Page page = currTaskServiceBiz.page(new Page<>(param.getCurrent(), param.getSize()), currTaskQueryWrapper); PageVo pageVo = new PageVo<>(page, CurrTaskMainQueryVo.class); + Assert.notNull("无执行中的任务!", pageVo.getRecords()); pageVo.getRecords().forEach(e -> { //根据当前主任务查详细任务 @@ -155,7 +156,7 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService iden.add(a.getIdenCardNum()); }); e.setMaterials(materialDes); - e.setCustomers(iden); + e.setIdens(iden); ArrayList customers = new ArrayList<>(); //根据标识卡号查订单的客户名并写入 e.getIdens().forEach(id -> { diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java index 5382a11..a720745 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java @@ -3,7 +3,9 @@ package com.mt.wms.empty.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.mt.wms.core.base.BaseService; +import com.mt.wms.core.dal.entity.OrderInfo; import com.mt.wms.core.dal.entity.TaskDetHis; +import com.mt.wms.core.dal.service.OrderInfoServiceBiz; import com.mt.wms.core.dal.service.TaskDetHisServiceBiz; import com.mt.wms.core.params.IdParam; import com.mt.wms.core.vo.PageVo; @@ -37,6 +39,8 @@ public class TaskDetHisServiceImpl extends BaseService implements TaskDetHisServ TaskDetHisServiceBiz taskDetHisServiceBiz; @Autowired TaskHisService taskhisService; + @Autowired + OrderInfoServiceBiz orderInfoService; @Override public R save(TaskDetHis taskDetHis) { @@ -89,6 +93,13 @@ public class TaskDetHisServiceImpl extends BaseService implements TaskDetHisServ queryWrapper.eq(TaskDetHis.TASK_ID, currTaskId.getCurrTaskId()) .eq(TaskDetHis.VALID, 1); Page page = taskDetHisServiceBiz.page(new Page<>(currTaskId.getCurrent(), currTaskId.getSize()), queryWrapper); - return successful(new PageVo<>(page, TaskHisDetVo.class)); + PageVo taskHisDetVoPageVo = new PageVo<>(page, TaskHisDetVo.class); + taskHisDetVoPageVo.getRecords().forEach( + e -> { + OrderInfo one = orderInfoService.getOne(new QueryWrapper().eq(OrderInfo.IDEN_CARD_NUM, e.getIdenCardNum())); + e.setProductModel(one.getProductModel()); + } + ); + return successful(taskHisDetVoPageVo); } } 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 2a10900..25f32f4 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 @@ -53,6 +53,39 @@ public class CurrTaskDetVo extends BaseVo implements PageVo.ConvertVo { @ApiModelProperty("重量") private Float weight; + @ApiModelProperty("标识卡号") + private String idenCardNum; + + /** + * 产品名称 + */ + @ApiModelProperty("产品名称") + private String productName; + + /** + * 材料牌号 + */ + @ApiModelProperty("材料牌号") + private String materialDes; + + /** + * 产品型号 + */ + @ApiModelProperty("产品型号") + private String productModel; + + /** + * 工艺要求 + */ + @ApiModelProperty("工艺要求") + private String craftIll; + + /** + * 单位 + */ + @ApiModelProperty("单位") + private Float unit; + /** * 数量,手动输入 */ 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 c5dd173..d41b02e 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 @@ -57,6 +57,11 @@ public class CurrTaskQueryVo extends BaseVo implements PageVo.ConvertVo { @ApiModelProperty("开始位置") private String startPosition; + /** + * 生产单号 + */ + @ApiModelProperty("生产单号") + private String sheetNo; /** * 目标位置指的是窑炉的位置 */ 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 ad09f49..9ba4498 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 @@ -46,6 +46,40 @@ public class TaskHisDetVo extends BaseVo implements PageVo.ConvertVo { */ @ApiModelProperty("历史任务id") private Long taskId; + + @ApiModelProperty("标识卡号") + private String idenCardNum; + + /** + * 产品名称 + */ + @ApiModelProperty("产品名称") + private String productName; + + /** + * 材料牌号 + */ + @ApiModelProperty("材料牌号") + private String materialDes; + + /** + * 产品型号 + */ + @ApiModelProperty("产品型号") + private String productModel; + + /** + * 工艺要求 + */ + @ApiModelProperty("工艺要求") + private String craftIll; + + /** + * 单位 + */ + @ApiModelProperty("单位") + private Float unit; + /** * 重量,手动输入 */ From 16c9cb0212795c2515cb3fc09234d0f700567308 Mon Sep 17 00:00:00 2001 From: Lin-XCC <754310653@QQ.COM> Date: Wed, 8 Dec 2021 16:20:13 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=A1=A8=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=AA=91=E7=82=89=E5=B7=A5=E8=89=BA=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mt/wms/core/dal/entity/CurrTask.java | 10 +++++++++- .../main/java/com/mt/wms/core/dal/entity/TaskHis.java | 10 +++++++++- .../java/com/mt/wms/core/dal/mapper/CurrTaskMapper.xml | 3 ++- .../java/com/mt/wms/core/dal/mapper/TaskHisMapper.xml | 3 ++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CurrTask.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CurrTask.java index 2ad7408..9b70e65 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CurrTask.java +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CurrTask.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 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> stoveCodes = bm.getData().getStoveCodes(); + //验证apms存在这个炉子 + boolean verifyCodes = false; + ArrayList codeStr = new ArrayList<>(); + stoveCodes.forEach(kilnMap -> { + codeStr.addAll(kilnMap.keySet()); + }); + for (String s : codeStr) + { + if (s.equals(kilnCode)) + { + verifyCodes = true; + break; + } + } + if (!verifyCodes) + { + return failed(kilnCode + " 验证APMS炉号失败!"); + } + + //通知apms创建一个生产单 + ApmsCreateProcessSheet apmsCreateSheet = new ApmsCreateProcessSheet(); + apmsCreateSheet.setWorkShopCode("BM"); + apmsCreateSheet.setStartTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); + apmsCreateSheet.setTechCode(param.getCraftCode()); + //fixme 暂时没有user信息 + apmsCreateSheet.setStartUser(""); + ArrayList createItems = new ArrayList<>(); + param.getDetParams().forEach(e -> { + CreateItem createItem = new CreateItem(); + createItem.setItemCode(e.getIdenCardNum()); + createItem.setQuantity(e.getQuantity().intValue()); + createItem.setWeight(e.getWeight().doubleValue()); + createItems.add(createItem); + }); + apmsCreateSheet.setItems(createItems); + R processSheet = apmsControl.createProcessSheet(apmsCreateSheet); + + if (processSheet.getData().getSuccess()) + { + //apms创建成功后写入数据库 + R mainTask = currTaskService.createProcessTask(param); + currTaskDetService.createProcessTaskDet(param.getDetParams(), mainTask.getData().getId()); + String sheetNo = processSheet.getData().getSheetNo(); + //将返回的生产单号写入到主任务中。 + CurrTask currTaskById = currTaskService.getCurrTaskById(mainTask.getData().getId()); + currTaskById.setSheetNo(sheetNo); + currTaskService.updateCurrTaskById(currTaskById); + return successful("创建成功,任务添加至等待执行队列。"); + } + else + { + return failed("创建失败,APMS报错:" + processSheet.getMsg()); + } } @PostMapping(value = "mainCurrentTaskNow") @ApiOperation(value = "首页-获取当前执行中的任务") - public R> mainCurrentTaskNow(BasePageParam param) { + public R> mainCurrentTaskNow(@Validated @RequestBody BasePageParam param) { return currTaskService.currentTaskMainPage(param); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java index 4118168..e3a15e9 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java @@ -30,8 +30,10 @@ public class TaskCreateParam extends BaseParam { private String targetPosition; @ApiModelProperty(value = "加工类型:0 初始加工,1 复加工 ,2 追加加工", required = true) private Integer processType; - @ApiModelProperty(value = "窑炉Id", required = true) + @ApiModelProperty(value = "窑炉Id", example = "1", required = true) private Long kilnId; + @ApiModelProperty(value = "工艺号", required = true) + private String craftCode; @ApiModelProperty(value = "详细信息", required = true) private List detParams; diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java index 53cd413..a334cad 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/CurrTaskService.java @@ -1,5 +1,6 @@ package com.mt.wms.empty.service; +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; @@ -22,11 +23,26 @@ public interface CurrTaskService { /** * 内部使用,获取详情任务的关联任务 + * * @param idParam 任务id * @return 任务实体 */ CurrTaskVo getCurrTask(IdParam idParam); + /** + * 内部使用,更新任务单号 + * + * @param id 任务id + */ + void updateCurrTaskById(CurrTask id); + + /** + * 内部使用,获取任务实体 + * + * @param id 任务id + * @return 任务实体 + */ + CurrTask getCurrTaskById(Long id); /** * 创建加工任务的主任务信息 diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java index c7d1814..0545a15 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java @@ -75,6 +75,7 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe e -> { OrderInfo one = orderInfoService.getOne(new QueryWrapper().eq(OrderInfo.IDEN_CARD_NUM, e.getIdenCardNum())); e.setProductModel(one.getProductModel()); + e.setCustomer(one.getCustomerName()); } ); return successful(currTaskDetVo); diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java index 242b44c..f317ff2 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java @@ -70,6 +70,16 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService return build; } + @Override + public CurrTask getCurrTaskById(Long id) { + return currTaskServiceBiz.getById(id); + } + + @Override + public void updateCurrTaskById(CurrTask id) { + currTaskServiceBiz.updateById(id); + } + @Override public R createProcessTask(TaskCreateParam param) { Assert.notNull("错误,加工类型不可为空!", param.getProcessType()); diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoHisServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoHisServiceImpl.java index 478fc94..bbe1207 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoHisServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/OrderInfoHisServiceImpl.java @@ -94,7 +94,7 @@ public class OrderInfoHisServiceImpl extends BaseService implements OrderInfoHis public R> getTaskInfo(OrderInfoTaskDetParam param) { //从历史任务详细中获取该标识卡和订单的所有订单 PageVo currOrderCurrTask = taskDetHisService.getHisOrderHisTask(param); - Assert.gtZero(currOrderCurrTask.getRecords().size(), "该订单暂无详细记录。"); + Assert.notNull("该订单下无历史任务!", currOrderCurrTask.getRecords()); //获取车辆信息 R> vehicle = vehicleService.list(new VehicleQueryParam()); Map> collect = vehicle.getData().stream().collect(Collectors.groupingBy(VehicleVo::getId)); diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java index a720745..52fef9e 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/TaskDetHisServiceImpl.java @@ -98,6 +98,7 @@ public class TaskDetHisServiceImpl extends BaseService implements TaskDetHisServ e -> { OrderInfo one = orderInfoService.getOne(new QueryWrapper().eq(OrderInfo.IDEN_CARD_NUM, e.getIdenCardNum())); e.setProductModel(one.getProductModel()); + e.setCustomer(one.getCustomerName()); } ); return successful(taskHisDetVoPageVo); From 4abf2d23aa6710a91a3cf2565fbe6cda36204bd5 Mon Sep 17 00:00:00 2001 From: Lin-XCC <754310653@QQ.COM> Date: Thu, 9 Dec 2021 16:25:20 +0800 Subject: [PATCH 13/15] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B7=A5=E8=89=BA?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E4=BE=9B=E5=8A=A0=E5=B7=A5=E5=8D=95=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E6=97=B6=E4=BD=BF=E7=94=A8=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mt/wms/core/dal/entity/CraftInfo.java | 137 ++++++++++++++++++ .../wms/core/dal/mapper/CraftInfoMapper.java | 16 ++ .../wms/core/dal/mapper/CraftInfoMapper.xml | 28 ++++ .../core/dal/service/CraftInfoServiceBiz.java | 16 ++ .../service/impl/CraftInfoServiceBizImpl.java | 20 +++ 5 files changed, 217 insertions(+) create mode 100644 6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CraftInfo.java create mode 100644 6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CraftInfoMapper.java create mode 100644 6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CraftInfoMapper.xml create mode 100644 6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/CraftInfoServiceBiz.java create mode 100644 6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/impl/CraftInfoServiceBizImpl.java diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CraftInfo.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CraftInfo.java new file mode 100644 index 0000000..7698dc9 --- /dev/null +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CraftInfo.java @@ -0,0 +1,137 @@ +package com.mt.wms.core.dal.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.baomidou.mybatisplus.extension.activerecord.Model; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + *

+ * 设备工艺信息 + *

+ * + * @author mt + * @since 2021-12-09 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("t_craft_info") +public class CraftInfo extends Model { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 删除标志,是否有效:1 可用 0不可用,2停止 + */ + @TableField("valid") + @TableLogic + private Integer valid; + + /** + * 添加时间,入库时间 + */ + @TableField("create_time") + private LocalDateTime createTime; + + /** + * 创建人id + */ + @TableField("creator_id") + private Integer creatorId; + + /** + * 更新人id + */ + @TableField("updater_id") + private Integer updaterId; + + /** + * 修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同 + */ + @TableField("update_time") + private LocalDateTime updateTime; + + /** + * 版本号 默认为 1 + */ + @TableField("version") + @Version + private String version; + + /** + * 状态,0:可用,1:不可用 + */ + @TableField("status") + private Integer status; + + /** + * 内部编码,系统自动生成 + */ + @TableField("inter_code") + private String interCode; + + /** + * 工艺号 + */ + @TableField("craft_code") + private String craftCode; + + /** + * 编码 + */ + @TableField("code") + private String code; + + /** + * 对应PLC值 + */ + @TableField("plc_value") + private Integer plcValue; + + /** + * 说明 + */ + @TableField("content") + private String content; + + + public static final String ID = "id"; + + public static final String VALID = "valid"; + + public static final String CREATE_TIME = "create_time"; + + public static final String CREATOR_ID = "creator_id"; + + public static final String UPDATER_ID = "updater_id"; + + public static final String UPDATE_TIME = "update_time"; + + public static final String VERSION = "version"; + + public static final String STATUS = "status"; + + public static final String INTER_CODE = "inter_code"; + + public static final String CRAFT_CODE = "craft_code"; + + public static final String CODE = "code"; + + public static final String PLC_VALUE = "plc_value"; + + public static final String CONTENT = "content"; + + @Override + protected Serializable pkVal() { + return this.id; + } + +} diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CraftInfoMapper.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CraftInfoMapper.java new file mode 100644 index 0000000..03289f5 --- /dev/null +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CraftInfoMapper.java @@ -0,0 +1,16 @@ +package com.mt.wms.core.dal.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.mt.wms.core.dal.entity.CraftInfo; + +/** + *

+ * 设备工艺信息 Mapper 接口 + *

+ * + * @author mt + * @since 2021-12-09 + */ +public interface CraftInfoMapper extends BaseMapper { + +} diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CraftInfoMapper.xml b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CraftInfoMapper.xml new file mode 100644 index 0000000..953ee3e --- /dev/null +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/CraftInfoMapper.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + id, valid, create_time, creator_id, updater_id, update_time, version, status, inter_code, craft_code, code, + plc_value, content + + + diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/CraftInfoServiceBiz.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/CraftInfoServiceBiz.java new file mode 100644 index 0000000..087fa8c --- /dev/null +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/CraftInfoServiceBiz.java @@ -0,0 +1,16 @@ +package com.mt.wms.core.dal.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.mt.wms.core.dal.entity.CraftInfo; + +/** + *

+ * 设备工艺信息 服务类 + *

+ * + * @author mt + * @since 2021-12-09 + */ +public interface CraftInfoServiceBiz extends IService { + +} diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/impl/CraftInfoServiceBizImpl.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/impl/CraftInfoServiceBizImpl.java new file mode 100644 index 0000000..af0e7d9 --- /dev/null +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/service/impl/CraftInfoServiceBizImpl.java @@ -0,0 +1,20 @@ +package com.mt.wms.core.dal.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.mt.wms.core.dal.entity.CraftInfo; +import com.mt.wms.core.dal.mapper.CraftInfoMapper; +import com.mt.wms.core.dal.service.CraftInfoServiceBiz; +import org.springframework.stereotype.Service; + +/** + *

+ * 设备工艺信息 服务实现类 + *

+ * + * @author mt + * @since 2021-12-09 + */ +@Service +public class CraftInfoServiceBizImpl extends ServiceImpl implements CraftInfoServiceBiz { + +} From db04b8348157bc8f27d74a027c89b2b0b9cc87b7 Mon Sep 17 00:00:00 2001 From: Lin-XCC <754310653@QQ.COM> Date: Thu, 9 Dec 2021 16:28:37 +0800 Subject: [PATCH 14/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E5=BD=93=E5=89=8D=E4=BB=BB=E5=8A=A1=E7=9A=84?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=EF=BC=8C=E6=B7=BB=E5=8A=A0=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=9A=84=E5=B7=A5=E8=89=BA=E4=BF=A1=E6=81=AF=EF=BC=8C=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E6=B7=BB=E5=8A=A0=E5=AD=97=E6=AE=B5=E5=8C=BA=E5=88=86?= =?UTF-8?q?=E8=BF=94=E5=B7=A5=E5=8D=95=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mt/wms/core/dal/entity/CurrTask.java | 18 +++++++++---- .../com/mt/wms/core/dal/entity/OrderInfo.java | 22 +++++++++------- .../mt/wms/core/dal/entity/OrderInfoHis.java | 22 +++++++++------- .../com/mt/wms/core/dal/entity/TaskHis.java | 18 +++++++++---- .../mt/wms/core/dal/mapper/CurrTaskMapper.xml | 25 ++++++++++--------- .../core/dal/mapper/OrderInfoHisMapper.xml | 5 +++- .../wms/core/dal/mapper/OrderInfoMapper.xml | 5 +++- .../mt/wms/core/dal/mapper/TaskHisMapper.xml | 25 ++++++++++--------- 8 files changed, 86 insertions(+), 54 deletions(-) diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CurrTask.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CurrTask.java index 9b70e65..a2c413a 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CurrTask.java +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/CurrTask.java @@ -15,7 +15,7 @@ import java.time.LocalDateTime; *

* * @author mt - * @since 2021-12-08 + * @since 2021-12-09 */ @Data @EqualsAndHashCode(callSuper = false) @@ -175,10 +175,16 @@ public class CurrTask extends Model { private String locationName; /** - * 窑炉工艺号 + * 工艺号ID,关联工艺号表:t_craft_info */ - @TableField("craft_code") - private String craftCode; + @TableField("f_craft_code_id") + private Long fCraftCodeId; + + /** + * 工艺号对应PLC值 + */ + @TableField("f_plc_value") + private Integer fPlcValue; public static final String ID = "id"; @@ -231,7 +237,9 @@ public class CurrTask extends Model { public static final String LOCATION_NAME = "location_name"; - public static final String CRAFT_CODE = "craft_code"; + public static final String F_CRAFT_CODE_ID = "f_craft_code_id"; + + public static final String F_PLC_VALUE = "f_plc_value"; @Override protected Serializable pkVal() { diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfo.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfo.java index e561ad4..1636215 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfo.java +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfo.java @@ -1,25 +1,21 @@ package com.mt.wms.core.dal.entity; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.extension.activerecord.Model; -import com.baomidou.mybatisplus.annotation.Version; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableField; -import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import java.io.Serializable; +import java.time.LocalDateTime; + /** *

* 订单任务表 *

* * @author mt - * @since 2021-11-18 + * @since 2021-12-09 */ @Data @EqualsAndHashCode(callSuper = false) @@ -100,6 +96,12 @@ public class OrderInfo extends Model { @TableField("order_no") private String orderNo; + /** + * 原订单号,APMS系统获取 返单时才存在 + */ + @TableField("old_order_no") + private String oldOrderNo; + /** * 标识卡号,APMS系统获取 */ @@ -209,6 +211,8 @@ public class OrderInfo extends Model { public static final String ORDER_NO = "order_no"; + public static final String OLD_ORDER_NO = "old_order_no"; + public static final String IDEN_CARD_NUM = "iden_card_num"; public static final String CUSTOMER_NO = "customer_no"; diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfoHis.java b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfoHis.java index f09911a..4c599ec 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfoHis.java +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/entity/OrderInfoHis.java @@ -1,25 +1,21 @@ package com.mt.wms.core.dal.entity; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.extension.activerecord.Model; -import com.baomidou.mybatisplus.annotation.Version; -import com.baomidou.mybatisplus.annotation.TableId; -import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.TableLogic; -import com.baomidou.mybatisplus.annotation.TableField; -import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import java.io.Serializable; +import java.time.LocalDateTime; + /** *

* 订单任务历史表 *

* * @author mt - * @since 2021-11-18 + * @since 2021-12-09 */ @Data @EqualsAndHashCode(callSuper = false) @@ -100,6 +96,12 @@ public class OrderInfoHis extends Model { @TableField("order_no") private String orderNo; + /** + * 原订单号,APMS系统获取,返工单才存在 + */ + @TableField("old_order_no") + private String oldOrderNo; + /** * 标识卡号,APMS系统获取 */ @@ -185,6 +187,8 @@ public class OrderInfoHis extends Model { public static final String ORDER_NO = "order_no"; + public static final String OLD_ORDER_NO = "old_order_no"; + public static final String IDEN_CARD_NUM = "iden_card_num"; public static final String CUSTOMER_NO = "customer_no"; 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 a7149c6..b3d00b9 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-12-08 + * @since 2021-12-09 */ @Data @EqualsAndHashCode(callSuper = false) @@ -175,10 +175,16 @@ public class TaskHis extends Model { private String locationName; /** - * 窑炉工艺号 + * 工艺号ID,关联工艺号表:t_craft_info */ - @TableField("craft_code") - private String craftCode; + @TableField("f_craft_code_id") + private Long fCraftCodeId; + + /** + * 工艺号对应PLC值 + */ + @TableField("f_plc_value") + private Integer fPlcValue; public static final String ID = "id"; @@ -231,7 +237,9 @@ public class TaskHis extends Model { public static final String LOCATION_NAME = "location_name"; - public static final String CRAFT_CODE = "craft_code"; + public static final String F_CRAFT_CODE_ID = "f_craft_code_id"; + + public static final String F_PLC_VALUE = "f_plc_value"; @Override protected Serializable pkVal() { 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 dd75888..375bce2 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 @@ -19,24 +19,25 @@ - - - - - - - - - - - + + + + + + + + + + + + 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, craft_code + kiln_id, kiln_name, vehicle_id, is_cache, location_id, location_name, f_craft_code_id, f_plc_value diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoHisMapper.xml b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoHisMapper.xml index 0476782..352684c 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoHisMapper.xml +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoHisMapper.xml @@ -16,6 +16,7 @@ + @@ -30,7 +31,9 @@ - id, valid, create_time, creator_id, updater_id, update_time, version, order_source, status, inter_code, code, order_no, iden_card_num, customer_no, customer_name, product_name, product_model, material_des, craft_ill, unit, weight, quantity + id, valid, create_time, creator_id, updater_id, update_time, version, order_source, status, inter_code, code, + order_no, old_order_no, iden_card_num, customer_no, customer_name, product_name, product_model, material_des, + craft_ill, unit, weight, quantity diff --git a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoMapper.xml b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoMapper.xml index c1efe7b..1131b73 100644 --- a/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoMapper.xml +++ b/6.program/wms-core/src/main/java/com/mt/wms/core/dal/mapper/OrderInfoMapper.xml @@ -16,6 +16,7 @@ + @@ -34,7 +35,9 @@ - id, valid, create_time, creator_id, updater_id, update_time, version, order_source, status, inter_code, code, order_no, iden_card_num, customer_no, customer_name, product_name, product_model, material_des, craft_ill, unit, weight, quantity, add_a, add_b, orther_a, orther_b + id, valid, create_time, creator_id, updater_id, update_time, version, order_source, status, inter_code, code, + order_no, old_order_no, iden_card_num, customer_no, customer_name, product_name, product_model, material_des, + craft_ill, unit, weight, quantity, add_a, add_b, orther_a, orther_b 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 09756ee..d6710d4 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 @@ -19,24 +19,25 @@ - - - - - - - - - - - + + + + + + + + + + + + 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, craft_code + kiln_id, kiln_name, vehicle_id, is_cache, location_id, location_name, f_craft_code_id, f_plc_value From 9f6d45bd91c001bf9518cd412ad5e20b6745c018 Mon Sep 17 00:00:00 2001 From: Lin-XCC <754310653@QQ.COM> Date: Fri, 10 Dec 2021 10:29:21 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=97=B6=E7=9A=84=E5=8F=82=E6=95=B0=E5=92=8C?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E6=B5=81=E7=A8=8B=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=AE=8C=E6=88=90=E4=BF=A1=E6=81=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../empty/controller/CurrTaskController.java | 14 ++-- .../empty/controller/OrderInfoController.java | 2 +- .../mt/wms/empty/params/TaskCreateParam.java | 10 +-- .../service/impl/CurrTaskServiceImpl.java | 7 ++ .../service/impl/OrderInfoServiceImpl.java | 70 +++++++++++++++---- .../java/com/mt/wms/empty/vo/OrderInfoVo.java | 30 ++------ 6 files changed, 83 insertions(+), 50 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 18c17a3..9defeb6 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 @@ -67,11 +67,11 @@ public class CurrTaskController extends BaseController { String kilnCode = kilnInfoVoR.getData().getCode(); R bm = apmsControl.getStoveCodeByWorkShopCode("BM"); ArrayList> stoveCodes = bm.getData().getStoveCodes(); - //验证apms存在这个炉子 + //验证apms数据中存在这个炉子 boolean verifyCodes = false; ArrayList codeStr = new ArrayList<>(); stoveCodes.forEach(kilnMap -> { - codeStr.addAll(kilnMap.keySet()); + codeStr.add(kilnMap.get("code")); }); for (String s : codeStr) { @@ -83,7 +83,7 @@ public class CurrTaskController extends BaseController { } if (!verifyCodes) { - return failed(kilnCode + " 验证APMS炉号失败!"); + return failed("创建失败,APMS中验证炉号" + kilnCode + "失败!"); } //通知apms创建一个生产单 @@ -91,8 +91,8 @@ public class CurrTaskController extends BaseController { apmsCreateSheet.setWorkShopCode("BM"); apmsCreateSheet.setStartTime(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); apmsCreateSheet.setTechCode(param.getCraftCode()); - //fixme 暂时没有user信息 - apmsCreateSheet.setStartUser(""); + //fixme 暂时没有正式user,使用测试账户 + apmsCreateSheet.setStartUser("QJJP03"); ArrayList createItems = new ArrayList<>(); param.getDetParams().forEach(e -> { CreateItem createItem = new CreateItem(); @@ -101,6 +101,7 @@ public class CurrTaskController extends BaseController { createItem.setWeight(e.getWeight().doubleValue()); createItems.add(createItem); }); + apmsCreateSheet.setStoveCode(kilnCode); apmsCreateSheet.setItems(createItems); R processSheet = apmsControl.createProcessSheet(apmsCreateSheet); @@ -114,11 +115,12 @@ public class CurrTaskController extends BaseController { CurrTask currTaskById = currTaskService.getCurrTaskById(mainTask.getData().getId()); currTaskById.setSheetNo(sheetNo); currTaskService.updateCurrTaskById(currTaskById); + //生成详细任务中的检验结果数据在apms推送生产单结果时创建 return successful("创建成功,任务添加至等待执行队列。"); } else { - return failed("创建失败,APMS报错:" + processSheet.getMsg()); + return failed("创建失败,APMS报错:" + processSheet.getData().getMsg()); } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoController.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoController.java index 750395f..df6b264 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoController.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/controller/OrderInfoController.java @@ -70,7 +70,7 @@ public class OrderInfoController extends BaseController { @PostMapping(value = "completeOrder") - @ApiOperation(value = "完成订单") + @ApiOperation(value = "人工完成订单(不需通知apms,仅在wms完成)") @Deprecated private R completeOrder(@Validated @RequestBody IdParam idParam) { return orderInfoService.completeOrder(idParam); diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java index e3a15e9..90d1fe9 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/TaskCreateParam.java @@ -22,13 +22,13 @@ public class TaskCreateParam extends BaseParam { private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "托盘号") - private String palletCode; - @ApiModelProperty(value = "起点", required = true) - private String startPosition; +// @ApiModelProperty(value = "托盘号") +// private String palletCode; +@ApiModelProperty(value = "起点(提升平台)", required = true) +private String startPosition; @ApiModelProperty(value = "终点位置", required = true) private String targetPosition; - @ApiModelProperty(value = "加工类型:0 初始加工,1 复加工 ,2 追加加工", required = true) + @ApiModelProperty(value = "加工类型:0 初始加工,1 复加工", required = true) private Integer processType; @ApiModelProperty(value = "窑炉Id", example = "1", required = true) private Long kilnId; diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java index f317ff2..fd97c52 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.mt.wms.core.api.Assert; import com.mt.wms.core.base.BaseService; import com.mt.wms.core.dal.entity.*; +import com.mt.wms.core.dal.service.CraftInfoServiceBiz; import com.mt.wms.core.dal.service.CurrTaskServiceBiz; import com.mt.wms.core.dal.service.OrderInfoServiceBiz; import com.mt.wms.core.params.BasePageParam; @@ -61,6 +62,8 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService @Autowired OrderInfoServiceBiz orderInfoServiceBiz; + @Autowired + CraftInfoServiceBiz craftInfoServiceBiz; @Override public CurrTaskVo getCurrTask(IdParam idParam) { @@ -87,6 +90,10 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService BeanUtils.copyProperties(param, currTask); currTask.setTaskType(TaskTypeEnum.WTK.getValue()); currTask.setTaskSource(0); + //根据工艺号查询工艺id以及工艺plc值 + CraftInfo one = craftInfoServiceBiz.getOne(new QueryWrapper().eq(CraftInfo.CREATOR_ID, param.getCraftCode())); + currTask.setFCraftCodeId(one.getId()); + currTask.setFPlcValue(one.getPlcValue()); setCommonField(currTask); currTaskServiceBiz.save(currTask); return successful(IdVo.builder().id(currTask.getId()).build()); 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 f12de12..245b0dd 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 @@ -17,6 +17,7 @@ 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.enums.WhetherEnum; import com.mt.wms.core.params.IdParam; import com.mt.wms.core.vo.PageVo; import com.mt.wms.core.vo.R; @@ -37,6 +38,7 @@ import java.time.LocalDateTime; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; /** @@ -92,13 +94,24 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic @Override public R> page(OrderInfoBasePageParam param) { - QueryWrapper wrapper=new QueryWrapper<>(); - wrapper.like(StringUtils.isNotBlank(param.getIdenCardNum()),OrderInfo.IDEN_CARD_NUM, param.getIdenCardNum()) - .like(StringUtils.isNotBlank(param.getOrderNo()),OrderInfo.ORDER_NO, param.getOrderNo()) - .eq(OrderInfo.VALID,1) + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.like(StringUtils.isNotBlank(param.getIdenCardNum()), OrderInfo.IDEN_CARD_NUM, param.getIdenCardNum()) + .like(StringUtils.isNotBlank(param.getOrderNo()), OrderInfo.ORDER_NO, param.getOrderNo()) + .eq(OrderInfo.VALID, 1) .orderByDesc(OrderInfo.CREATE_TIME); Page page = orderInfoService.page(new Page<>(param.getCurrent(), param.getSize()), wrapper); - return successful(new PageVo<>(page,OrderInfoVo.class)); + PageVo orderInfoVoPageVo = new PageVo<>(page, OrderInfoVo.class); + orderInfoVoPageVo.getRecords().forEach(e -> + { + R info = getTaskInfoByIdenCardNum(e.getIdenCardNum()); + e.setFinishWeight(info.getData().getFinishWeight()); + e.setFinishQuantity(info.getData().getQuantity()); + e.setWaitWeight(info.getData().getWaitWeight()); + e.setWaitQuantity(info.getData().getWaitQuantity()); + e.setReProcessQuantity(info.getData().getReProcessQuantity()); + e.setReProcessWeight(info.getData().getReProcessWeight()); + }); + return successful(orderInfoVoPageVo); } @Override @@ -117,7 +130,14 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic public R getOne(IdParam idParam) { OrderInfo byId = orderInfoService.getById(idParam.getId()); OrderInfoVo build = OrderInfoVo.builder().build(); - BeanUtils.copyProperties(byId,build); + BeanUtils.copyProperties(byId, build); + R info = getTaskInfoByIdenCardNum(build.getIdenCardNum()); + build.setFinishWeight(info.getData().getFinishWeight()); + build.setFinishQuantity(info.getData().getQuantity()); + build.setWaitWeight(info.getData().getWaitWeight()); + build.setWaitQuantity(info.getData().getWaitQuantity()); + build.setReProcessQuantity(info.getData().getReProcessQuantity()); + build.setReProcessWeight(info.getData().getReProcessWeight()); return successful(build); } @@ -179,8 +199,26 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic build.setFinishQuantity(sumTaskHis.get("quantity").floatValue()); build.setFinishWeight(sumTaskHis.get("weight").floatValue()); - build.setLastQuantity(build.getQuantity() - build.getFinishQuantity() - build.getWaitQuantity()); - build.setLastWeight(build.getWeight() - build.getFinishWeight() - build.getWaitWeight()); + // 考虑返工单的加工情况,添加到返工统计信息中。 + if (Objects.nonNull(one.getOldOrderNo())) + { + List list = orderInfoService.list(new QueryWrapper().eq(OrderInfo.VALID, 1).eq(OrderInfo.ORDER_NO, one.getOldOrderNo())); + float reQuantity = 0; + float reWeight = 0; + for (OrderInfo orderInfo : list) + { + HashMap reCurrTask = currTaskDetService.getSumByIdCard(orderInfo.getIdenCardNum()); + reQuantity += reCurrTask.get("quantity").floatValue(); + reWeight += reCurrTask.get("weight").floatValue(); + + HashMap reTaskHis = taskDetHisService.getSumByIdCard(orderInfo.getIdenCardNum()); + reQuantity += reTaskHis.get("quantity").floatValue(); + reWeight += reTaskHis.get("weight").floatValue(); + } + build.setReProcessQuantity(reQuantity); + build.setReProcessWeight(reWeight); + } + return successful(build); } @@ -202,7 +240,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic byId.setValid(0); byId.setStatus(2); orderInfoService.updateById(byId); - return successful("操作成功。"); + return successful("订单状态成功置为完成。"); } @Override @@ -210,7 +248,7 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic OrderInfo byId = orderInfoService.getById(idParam.getId()); byId.setValid(0); orderInfoService.updateById(byId); - return successful("操作成功。"); + return successful("订单状态成功置为作废。"); } @Override @@ -231,13 +269,17 @@ public class OrderInfoServiceImpl extends BaseService implements OrderInfoServic @Override public R apmsCompleteOrder(ApmsCompleteOrder apmsCompleteOrder) { //通过标识卡号与生产单号进行更新检验结果 - ApmsCheckResult one = apmsCheckResultServiceBiz.getOne(new QueryWrapper().eq(ApmsCheckResult.IDEN_CARD_NUM, apmsCompleteOrder.getIdenCardNum()).eq(ApmsCheckResult.SHEET_NO, apmsCompleteOrder.getSheetNo())); + ApmsCheckResult one = new ApmsCheckResult(); + one.setIdenCardNum(apmsCompleteOrder.getIdenCardNum()); + one.setSheetNo(apmsCompleteOrder.getSheetNo()); + one.setCreateTime(LocalDateTime.now()); + one.setValid(WhetherEnum.YES.getValue()); 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()); + apmsCheckResultServiceBiz.save(one); + //订单不应该在该地方完成,额外提供一个完成接口供人工完成,不通知apms + return successful("任务执行完成。"); } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java index e887ce3..8bb80c0 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/vo/OrderInfoVo.java @@ -28,12 +28,6 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo { */ @ApiModelProperty(value = "主键") private Long id; - /** - * 删除标志,是否有效:1 可用 0不可用,2停止 - */ - @ApiModelProperty("删除标志") - private Integer valid; - /** * 来源:1.APMS 2.人工输入 */ @@ -45,18 +39,6 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo { @ApiModelProperty(value = "添加时间") private LocalDateTime createTime; - /** - * 创建人id - */ - @ApiModelProperty(value = "创建人id") - private Integer creatorId; - - /** - * 更新人id - */ - @ApiModelProperty(value = "更新人id") - private Integer updaterId; - /** * 修改时间,更具修改时间来判断下次执行顺序,第一次修改时间和新增时间相同 */ @@ -164,15 +146,15 @@ public class OrderInfoVo extends BaseVo implements PageVo.ConvertVo { private Float waitQuantity; /** - * 剩余重量 完全未处理 + * 返工重量 返工单中计算的值 */ - @ApiModelProperty(value = "剩余重量") - private Float lastWeight; + @ApiModelProperty(value = "返工重量") + private Float reProcessWeight; /** - * 剩余数量 完全未处理 + * 返工数量 返工单中计算的值 */ - @ApiModelProperty(value = "剩余数量") - private Float lastQuantity; + @ApiModelProperty(value = "返工数量") + private Float reProcessQuantity; }