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 42f0e8b..d63a6a3 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 @@ -103,7 +103,7 @@ public class ApmsController extends BaseController { * @return 删除结果 */ @PostMapping(value = "deleteBySheetNo") - @ApiOperation(value = "通知APMS删除生产单", hidden = true) + @ApiOperation(value = "通知APMS删除生产单", hidden = false) public R deleteBySheetNo(@Validated @RequestBody String sheetNo) { checkToken(); HashMap paramMap = new HashMap<>(); @@ -121,12 +121,13 @@ public class ApmsController extends BaseController { } @PostMapping(value = "createProcessSheet") - @ApiOperation(value = "通知APMS创建生产单接口", hidden = true) + @ApiOperation(value = "通知APMS创建生产单接口", hidden = false) public R createProcessSheet(@Validated @RequestBody ApmsCreateProcessSheet apmsCreateProcess) { checkToken(); String paramJson = JSONUtil.toJsonStr(apmsCreateProcess); HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/createProcessSheet") .header("token", Token).body(paramJson, ContentType.JSON.toString()).execute(); + int status = response.getStatus(); CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); communicationLog.setLogName("WMS通知APMS创建生产单"); @@ -134,16 +135,24 @@ public class ApmsController extends BaseController { communicationLog.setContent("param:" + paramJson + "\nresult:" + response.body()); setCommonField(communicationLog); communicationLogServiceBiz.save(communicationLog); - return successful(JSONUtil.toBean(response.body(), ApmsCreateProcessSheetVo.class)); + if (status == 200) + { + return successful(JSONUtil.toBean(response.body(), ApmsCreateProcessSheetVo.class)); + } + else + { + return failed(status, response.body()); + } } @PostMapping(value = "startProcess") - @ApiOperation(value = "通知APMS生产单开始处理", hidden = true) + @ApiOperation(value = "通知APMS生产单开始处理", hidden = false) public R startProcess(@Validated @RequestBody ApmsStartProcess apmsStartProcess) { checkToken(); String paramJson = JSONUtil.toJsonStr(apmsStartProcess); HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/startProcess") .header("token", Token).body(paramJson, ContentType.JSON.toString()).execute(); + int status = response.getStatus(); CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); communicationLog.setLogName("WMS通知APMS生产单开始处理"); @@ -151,16 +160,24 @@ public class ApmsController extends BaseController { communicationLog.setContent("param:" + paramJson + "\nresult:" + response.body()); setCommonField(communicationLog); communicationLogServiceBiz.save(communicationLog); - return successful(JSONUtil.toBean(response.body(), ApmsStartProcess.class)); + if (status == 200) + { + return successful(JSONUtil.toBean(response.body(), ApmsStartProcess.class)); + } + else + { + return failed(status, response.body()); + } } @PostMapping(value = "endProcess") - @ApiOperation(value = "通知APMS生产单结束处理", hidden = true) + @ApiOperation(value = "通知APMS生产单结束处理", hidden = false) public R endProcess(@Validated @RequestBody ApmsEndProcess apmsEndProcess) { checkToken(); String paramJson = JSONUtil.toJsonStr(apmsEndProcess); HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/endProcess") .header("token", Token).body(paramJson, ContentType.JSON.toString()).execute(); + int status = response.getStatus(); CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); communicationLog.setLogName("WMS通知APMS生产单结束处理"); @@ -168,16 +185,24 @@ public class ApmsController extends BaseController { communicationLog.setContent("param:" + paramJson + "\nresult:" + response.body()); setCommonField(communicationLog); communicationLogServiceBiz.save(communicationLog); - return successful(JSONUtil.toBean(response.body(), ApmsEndProcessVo.class)); + if (status == 200) + { + return successful(JSONUtil.toBean(response.body(), ApmsEndProcessVo.class)); + } + else + { + return failed(status, response.body()); + } } @PostMapping(value = "finishProcessSheet") - @ApiOperation(value = "通知APMS完成生产单接口", hidden = true) + @ApiOperation(value = "通知APMS完成生产单接口", hidden = false) public R finishProcessSheet(@Validated @RequestBody ApmsFinishProcessSheet apmsFinishProcessSheet) { checkToken(); String paramJson = JSONUtil.toJsonStr(apmsFinishProcessSheet); HttpResponse response = HttpUtil.createPost(ApiAddress + "/platform/api/finishProcessSheet") .header("token", Token).body(paramJson, ContentType.JSON.toString()).execute(); + int status = response.getStatus(); CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); communicationLog.setLogName("WMS通知APMS完成生产单"); @@ -185,7 +210,14 @@ public class ApmsController extends BaseController { communicationLog.setContent("param:" + paramJson + "\nresult:" + response.body()); setCommonField(communicationLog); communicationLogServiceBiz.save(communicationLog); - return successful(JSONUtil.toBean(response.body(), ApmsFinishProcessSheetVo.class)); + if (status == 200) + { + return successful(JSONUtil.toBean(response.body(), ApmsFinishProcessSheetVo.class)); + } + else + { + return failed(status, response.body()); + } } @PostMapping(value = "getApmsToken") @@ -211,13 +243,14 @@ public class ApmsController extends BaseController { } @PostMapping(value = "getStoveCodeByWorkShopCode") - @ApiOperation(value = "WMS通过APMS使用车间编码获取炉号信息", hidden = true) + @ApiOperation(value = "WMS通过APMS使用车间编码获取炉号信息", hidden = false) public R getStoveCodeByWorkShopCode(String workShopCode) { checkToken(); HashMap paramMap = new HashMap<>(); paramMap.put("workShopCode", workShopCode); HttpResponse response = HttpUtil.createGet(ApiAddress + "/platform/api/getStoveCodeByWorkShopCode") .header("token", Token).form(paramMap).execute(); + int status = response.getStatus(); CommunicationLog communicationLog = new CommunicationLog(); communicationLog.setCode("APMS" + System.currentTimeMillis()); communicationLog.setLogName("WMS通过APMS使用车间编码获取炉号信息"); @@ -225,7 +258,14 @@ public class ApmsController extends BaseController { communicationLog.setContent("param:" + paramMap + "\nresult:" + response.body()); setCommonField(communicationLog); communicationLogServiceBiz.save(communicationLog); - return successful(JSONUtil.toBean(response.body(), ApmsStoveVo.class)); + if (status == 200) + { + return successful(JSONUtil.toBean(response.body(), ApmsStoveVo.class)); + } + else + { + return failed(status, response.body()); + } } private void checkToken() { 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 a549569..a27d263 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 @@ -27,10 +27,10 @@ public class ApmsFinishProcessSheet extends BaseParam { @ApiModelProperty(value = "完成加工人:为APMS账号", required = true) private String endUser; - @ApiModelProperty(value = "配炉号", required = true) - private String stoveCode; - @ApiModelProperty(value = "备注", required = false) private String remark; + + @ApiModelProperty(value = "生产单号", required = false) + private String sheetNo; } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsStartProcess.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsStartProcess.java index 29f9920..240fc7d 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsStartProcess.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/params/ApmsStartProcess.java @@ -29,6 +29,6 @@ public class ApmsStartProcess extends BaseParam { private String stoveCode; @ApiModelProperty(value = "工艺号", required = false) - private String techCode; + private String techName; } 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 index 1b6821f..2f7feb2 100644 --- 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 @@ -10,7 +10,7 @@ import lombok.experimental.Accessors; @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) -@ApiModel(value = "Apms生产单详细", description = "Apms生产单详细") +@ApiModel(value = "Apms生产单结束详细", description = "Apms生产单结束详细") public class FinishItem extends BaseParam { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "标识卡号", required = true)