From 17c8fc81b7216d71dba3b1677076003d1b16f5a8 Mon Sep 17 00:00:00 2001 From: psh Date: Tue, 16 Jul 2024 10:49:51 +0800 Subject: [PATCH] =?UTF-8?q?155=E5=A4=96=E9=9D=A2=E5=A4=9A=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E5=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/wms/mes/controller/MesController.java | 22 ++++++++++++------- .../org/nl/wms/mes/domain/QPMES155Data.java | 17 ++++++++++++++ .../nl/wms/mes/domain/QPMES155Response.java | 9 ++++---- 3 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES155Data.java diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java index 404cfc7..297aadb 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/controller/MesController.java @@ -181,13 +181,15 @@ public class MesController { QPMES155Response qpmes155Response =new QPMES155Response(); QPMES155Request qpmes155Request=notice.toJavaObject(QPMES155Request.class); log.info(qpmes155Request.toString()); - for(QPMES155RequestBody temp:qpmes155Request.getBODY()){ - try{ - Workorder workorder =new Workorder(); - workorder.copyFrom(temp); - workorderService.create(workorder); - }catch (Exception e){ - log.error("工单已存在导致新增失败,{}{}",e,e.getMessage()); + if(ObjectUtil.isNotEmpty(qpmes155Request)) { + for (QPMES155RequestBody temp : qpmes155Request.getBODY()) { + try { + Workorder workorder = new Workorder(); + workorder.copyFrom(temp); + workorderService.create(workorder); + } catch (Exception e) { + log.error("工单已存在导致新增失败,{}{}", e, e.getMessage()); + } } } Head head=new Head(); @@ -195,7 +197,11 @@ public class MesController { head.setINTF_ID("QPMES155"); head.setSRC_MSGID(IdUtil.simpleUUID()); head.setSRC_SYSTEM("AGV"); - qpmes155Response.setHEAD(head); + QPMES155Data qpmes155Data=new QPMES155Data(); + qpmes155Data.setHEAD(head); + qpmes155Response.setData(qpmes155Data); + qpmes155Response.setMsg("数据接收成功"); + qpmes155Response.setCode("0"); log.info("QPMES155服务被调用{}",qpmes155Response.toString()); return qpmes155Response; } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES155Data.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES155Data.java new file mode 100644 index 0000000..c4fafc0 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES155Data.java @@ -0,0 +1,17 @@ +package org.nl.wms.mes.domain; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import lombok.ToString; + +import java.util.List; + +@Data +@ToString +public class QPMES155Data { + @JSONField(name = "HEAD") + private Head HEAD; + @JSONField(name = "BODY") + private List BODY; + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES155Response.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES155Response.java index 907a78e..19e050e 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES155Response.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/mes/domain/QPMES155Response.java @@ -9,9 +9,10 @@ import java.util.List; @Data @ToString public class QPMES155Response { - @JSONField(name = "HEAD") - private Head HEAD; - @JSONField(name = "BODY") - private List BODY; + private String code; + + private String msg; + + private QPMES155Data data; }