From 608e6b5a45d2e53879b10aca3475dd8df92e5e5f Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期一, 22 十二月 2025 20:18:02 +0800
Subject: [PATCH] bug修复

---
 src/main/resources/mapper/ViewWorkInMapper.xml                    |    4 
 src/main/webapp/static/js/report/workIn.js                        |    4 
 src/main/webapp/views/report/viewWorkIn.html                      |    2 
 src/main/java/com/zy/api/entity/ReportOrderParams.java            |    7 
 src/main/java/com/zy/api/entity/OrderParams.java                  |    4 
 src/main/java/com/zy/api/service/impl/AgvScheduleServiceImpl.java |    4 
 src/main/java/com/zy/api/enums/MatLocType.java                    |   14 +
 src/main/java/com/zy/asrs/utils/Utils.java                        |   11 +
 src/main/java/com/zy/asrs/entity/Mat.java                         |   49 -----
 src/main/java/com/zy/asrs/entity/ViewWorkInBean.java              |   47 ++++-
 src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java      |  302 ++++++++++++++++++++++---------------
 src/main/resources/mapper/OrderDetlPakoutMapper.xml               |    3 
 src/main/webapp/static/js/common.js                               |    4 
 13 files changed, 265 insertions(+), 190 deletions(-)

diff --git a/src/main/java/com/zy/api/entity/OrderParams.java b/src/main/java/com/zy/api/entity/OrderParams.java
index 0dcdc30..e865e5d 100644
--- a/src/main/java/com/zy/api/entity/OrderParams.java
+++ b/src/main/java/com/zy/api/entity/OrderParams.java
@@ -57,8 +57,8 @@
     private String cus_address;
 
 
-
-
+    @ApiModelProperty("WMS ID")
+    private String wms_id;
 
 
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
diff --git a/src/main/java/com/zy/api/entity/ReportOrderParams.java b/src/main/java/com/zy/api/entity/ReportOrderParams.java
index 848c55b..99585b2 100644
--- a/src/main/java/com/zy/api/entity/ReportOrderParams.java
+++ b/src/main/java/com/zy/api/entity/ReportOrderParams.java
@@ -45,4 +45,11 @@
         @ApiModelProperty("宸紓鏁伴噺")
         private Integer diff_qty;
 
+        @ApiModelProperty("鍘熶笂鏋舵淳宸ユ暟閲�")
+        private Integer old_qty;
+
+        @ApiModelProperty("鍙樻洿鏁伴噺")
+        private Integer new_qty;
+
+
 }
diff --git a/src/main/java/com/zy/api/enums/MatLocType.java b/src/main/java/com/zy/api/enums/MatLocType.java
index 8d683ab..714ac23 100644
--- a/src/main/java/com/zy/api/enums/MatLocType.java
+++ b/src/main/java/com/zy/api/enums/MatLocType.java
@@ -48,4 +48,18 @@
             return null;
         }
     }
+
+
+    
+    public static String getMatTag(String type) {
+        if (type.equals(MatLocType.AUTOMATED.type)) {
+            return MatType.LARGE.type;
+        } else if (type.equals(MatLocType.SO_HOLDING.type)) {
+            return MatType.MIDDEL.type;
+        } else if (type.equals(MatLocType.EO_HOLDING.type)) {
+            return MatType.SMALL.type;
+        } else {
+            return null;
+        }
+    }
 }
diff --git a/src/main/java/com/zy/api/service/impl/AgvScheduleServiceImpl.java b/src/main/java/com/zy/api/service/impl/AgvScheduleServiceImpl.java
index fceaab9..a268ab6 100644
--- a/src/main/java/com/zy/api/service/impl/AgvScheduleServiceImpl.java
+++ b/src/main/java/com/zy/api/service/impl/AgvScheduleServiceImpl.java
@@ -69,7 +69,7 @@
                 .contains(task.getIoType())) {
             // 鍏ュ簱
             task.setWrkSts(TaskStatusType.AGV_TASK_ISSUED_IN.type);
-        } else if (Arrays.asList(TaskIOType.ALL_OUT.type, TaskIOType.PICK_OUT.type, TaskIOType.MERGE_OUT.type)
+        } else if (Arrays.asList(TaskIOType.ALL_OUT.type, TaskIOType.PICK_OUT.type, TaskIOType.MERGE_OUT.type, TaskIOType.EMPTY_OUT.type)
                 .contains(task.getIoType())) {
             // 鍑哄簱
             task.setWrkSts(TaskStatusType.AGV_TASK_ISSUED_OUT.type);
@@ -109,7 +109,7 @@
                 task.setWrkSts(TaskStatusType.AGV_TASK_FINISHED_IN.type);
 
             }
-        } else if (Arrays.asList(TaskIOType.ALL_OUT.type, TaskIOType.PICK_OUT.type, TaskIOType.MERGE_OUT.type)
+        } else if (Arrays.asList(TaskIOType.ALL_OUT.type, TaskIOType.PICK_OUT.type, TaskIOType.MERGE_OUT.type, TaskIOType.EMPTY_OUT.type)
                 .contains(task.getIoType())) {
             // 鍑哄簱
             if (params.getStatus().equals("RUNNING")) {
diff --git a/src/main/java/com/zy/asrs/entity/Mat.java b/src/main/java/com/zy/asrs/entity/Mat.java
index 491b94e..6efecb1 100644
--- a/src/main/java/com/zy/asrs/entity/Mat.java
+++ b/src/main/java/com/zy/asrs/entity/Mat.java
@@ -380,52 +380,7 @@
         this.memo = memo;
     }
 
-//    Mat mat = new Mat(
-//            null,    // 缂栧彿
-//            null,    // 鎵�灞炲綊绫�
-//            null,    // 鍟嗗搧缂栧彿
-//            null,    // 鍟嗗搧鍚嶇О
-//            null,    // 鍒悕
-//            null,    // 瑙勬牸
-//            null,    // 鍨嬪彿
-//            null,    // 棰滆壊
-//            null,    // 鍝佺墝
-//            null,    // 鍗曚綅
-//            null,    // 鍗曚环
-//            null,    // sku
-//            null,    // 鍗曚綅閲�
-//            null,    // 鏉$爜
-//            null,    // 浜у湴
-//            null,    // 鍘傚
-//            null,    // 鐢熶骇鏃ユ湡
-//            null,    // 鍝侀」鏁�
-//            null,    // 瀹夊叏搴撳瓨閲�
-//            null,    // 閲嶉噺
-//            null,    // 闀垮害
-//            null,    // 浣撶Н
-//            null,    // 涓夋柟缂栫爜
-//            null,    // 渚涘簲鍟�
-//            null,    // 渚涘簲鍟嗙紪鐮�
-//            null,    // 鏄惁鎵规
-//            null,    // 淇濊川鏈�
-//            null,    // 棰勮澶╂暟
-//            null,    // 鍒惰喘
-//            null,    // 瑕佹眰妫�楠�
-//            null,    // 鍗遍櫓鍝�
-//            null,    // 鐘舵�乕闈炵┖]
-//            null,    // 娣诲姞浜哄憳
-//            null,    // 娣诲姞鏃堕棿
-//            null,    // 淇敼浜哄憳
-//            null,    // 淇敼鏃堕棿
-//            null    // 澶囨敞
-//    );
-
     public String getTagId$(){
-//        TagService service = SpringUtils.getBean(TagService.class);
-//        Tag tag = service.selectById(this.tagId);
-//        if (!Cools.isEmpty(tag)){
-//            return String.valueOf(tag.getName());
-//        }
         return MatLocType.getTagName(this.tagId + "");
     }
 
@@ -443,6 +398,10 @@
         return null;
     }
 
+    public String getProType(){
+        return MatLocType.getMatTag(this.tagId + "");
+    }
+
     public String getBeBatch$(){
         if (null == this.beBatch){ return null; }
         switch (this.beBatch){
diff --git a/src/main/java/com/zy/asrs/entity/ViewWorkInBean.java b/src/main/java/com/zy/asrs/entity/ViewWorkInBean.java
index 23f6b0d..8e4b75f 100644
--- a/src/main/java/com/zy/asrs/entity/ViewWorkInBean.java
+++ b/src/main/java/com/zy/asrs/entity/ViewWorkInBean.java
@@ -3,6 +3,7 @@
 import com.baomidou.mybatisplus.annotations.TableField;
 import com.core.common.Cools;
 import com.core.common.SpringUtils;
+import com.zy.asrs.service.MatService;
 import com.zy.system.entity.User;
 import com.zy.system.service.UserService;
 import io.swagger.annotations.ApiModelProperty;
@@ -35,13 +36,16 @@
 	private String crn_end_time;
 
 	@ApiModelProperty(value= "宸ヤ綔鍙�")
-	private Integer wrk_no;
+	@TableField("wrk_no")
+	private Integer wrkNo;
 
 	@ApiModelProperty(value= "宸ヤ綔鏃堕棿")
-	private Date io_time;
+	@TableField("io_time")
+	private Date ioTime;
 
 	@ApiModelProperty(value= "搴撲綅鍙�")
-	private String loc_no;
+	@TableField("loc_no")
+	private String locNo;
 
 	@ApiModelProperty(value= "鎵樼洏鏉$爜")
 	private String zpallet;
@@ -114,13 +118,15 @@
 	private Double volume;
 
 	@ApiModelProperty(value= "涓夋柟缂栫爜")
-	private String three_code;
+	@TableField("three_code")
+	private String threeCode;
 
 	@ApiModelProperty(value= "渚涘簲鍟�")
 	private String supp;
 
 	@ApiModelProperty(value= "渚涘簲鍟嗙紪鐮�")
-	private String supp_code;
+	@TableField("supp_code")
+	private String suppCode;
 
 	@ApiModelProperty(value= "鏄惁鎵规 1: 鏄�  0: 鍚�  ")
 	private Integer be_batch;
@@ -141,23 +147,27 @@
 	private Integer danger;
 
 	@ApiModelProperty(value= "淇敼浜哄憳")
-	private Long modi_user;
+	@TableField("modi_user")
+	private Long modiUser;
 
 	@ApiModelProperty(value= "淇敼鏃堕棿")
-	private Object modi_time;
+	@TableField("modi_time")
+	private Object modiTime;
 
 	@ApiModelProperty(value= "鍒涘缓鑰�")
-	private Long appe_user;
+	@TableField("appe_user")
+	private Long appeUser;
 
 	@ApiModelProperty(value= "娣诲姞鏃堕棿")
-	private Object appe_time;
+	@TableField("appe_time")
+	private Object appeTime;
 
 	@ApiModelProperty(value= "澶囨敞")
 	private String memo;
 
 	public String getModiUser$(){
 		UserService service = SpringUtils.getBean(UserService.class);
-		User user = service.selectById(this.modi_user);
+		User user = service.selectById(this.modiUser);
 		if (!Cools.isEmpty(user)){
 			return String.valueOf(user.getUsername());
 		}
@@ -166,7 +176,7 @@
 
 	public String getAppeUser$(){
 		UserService service = SpringUtils.getBean(UserService.class);
-		User user = service.selectById(this.appe_user);
+		User user = service.selectById(this.appeUser);
 		if (!Cools.isEmpty(user)){
 			return String.valueOf(user.getUsername());
 		}
@@ -174,10 +184,21 @@
 	}
 
 	public String getIoTime$(){
-		if (Cools.isEmpty(this.io_time)){
+		if (Cools.isEmpty(this.ioTime)){
 			return "";
 		}
-		return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.io_time);
+		return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.ioTime);
+	}
+
+	public String getTag$() {
+		if (!Cools.isEmpty(this.matnr)){
+			MatService matnrService = SpringUtils.getBean(MatService.class);
+			Mat matnr = matnrService.selectByMatnr(this.matnr);
+			if (!Cools.isEmpty(matnr)){
+				return matnr.getTagId$();
+			}
+		}
+		return "";
 	}
 
 	public void setQuery_date(String query_date) {
diff --git a/src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java b/src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java
index 620ca37..35cd074 100644
--- a/src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java
@@ -6,6 +6,8 @@
 import com.core.common.DateUtils;
 import com.core.exception.CoolException;
 import com.zy.api.entity.ReportOrderParam;
+import com.zy.api.entity.ReportOrderParams;
+import com.zy.api.entity.dto.XSR;
 import com.zy.api.service.KopenApiService;
 import com.zy.asrs.entity.*;
 import com.zy.asrs.enums.OrderTypeEnum;
@@ -13,6 +15,7 @@
 import com.zy.asrs.task.AbstractHandler;
 import com.zy.asrs.task.core.ReturnT;
 import com.zy.asrs.utils.OrderInAndOutUtil;
+import com.zy.asrs.utils.Utils;
 import com.zy.common.constant.MesConstant;
 import com.zy.common.model.DetlDto;
 import com.zy.common.model.MesPakinParam;
@@ -26,7 +29,9 @@
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
+import java.util.Objects;
 
 /**
  * Created by vincent on 2020/7/7
@@ -46,11 +51,13 @@
     @Autowired
     private DocTypeService docTypeService;
     @Autowired
-    private OrderPakinService  orderPakinService;
+    private OrderPakinService orderPakinService;
     @Autowired
     private OrderDetlPakinService orderDetlPakinService;
     @Autowired
     private KopenApiService kopenApiService;
+    @Autowired
+    private MatService matService;
 
     @Transactional
     public ReturnT<String> startOrderIssuedOnceMore(Order order) {
@@ -60,7 +67,7 @@
         }
 
         Order order1 = OrderInAndOutUtil.selectByNo(order.getPakinPakoutStatus$(), order.getOrderNo());
-        if (!Cools.isEmpty(order1)){
+        if (!Cools.isEmpty(order1)) {
             return FAIL.setMsg("璇风瓑寰�...璁㈠崟鎵ц妗f姝e湪杞巻鍙叉。妗堬紒锛侊紒");
         }
         List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(order.getPakinPakoutStatus$(), order.getId());
@@ -70,12 +77,12 @@
 
         // 鍗曟嵁鏄庣粏妗�
         List<OrderDetl> orderDetlList = orderDetlService.selectByOrderId(order.getId());
-        for (OrderDetl orderDetl : orderDetlList){
-            if (orderDetl.getQty().equals(0D)){
+        for (OrderDetl orderDetl : orderDetlList) {
+            if (orderDetl.getQty().equals(0D)) {
                 continue;
             }
             orderDetl.setWorkQty(orderDetl.getQty());
-            orderDetl.setAnfme(orderDetl.getAnfme()-orderDetl.getQty());
+            orderDetl.setAnfme(orderDetl.getAnfme() - orderDetl.getQty());
             orderDetl.setQty(0D);
             orderDetlService.updateById(orderDetl);
         }
@@ -87,7 +94,7 @@
         return SUCCESS;
     }
 
-    @Transactional
+    @Transactional(rollbackFor = Exception.class)
     public ReturnT<String> startOrderIssued(Order order) {
         DocType docType = docTypeService.selectById(order.getDocType());
         if (null == docType) {
@@ -95,20 +102,25 @@
         }
         List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId());
 
-        OrderInAndOutUtil.insertOrder(order.getPakinPakoutStatus$(),order);
+        OrderInAndOutUtil.insertOrder(order.getPakinPakoutStatus$(), order);
         // 鍗曟嵁鏄庣粏妗�
         List<DetlDto> list = new ArrayList<>();
         List<OrderDetl> orderDetlList = new ArrayList<>();
 
         for (OrderDetl detail : orderDetls) {
-            DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(),detail.getBrand(),detail.getStandby1(),detail.getStandby2(),detail.getStandby3(),
-                    detail.getBoxType1(),detail.getBoxType2(),detail.getBoxType3(), detail.getAnfme(), detail.getThreeCode());
+            DetlDto dto = new DetlDto(detail.getMatnr(), detail.getBatch(), detail.getBrand(), detail.getStandby1(),
+                    detail.getStandby2(), detail.getStandby3(),
+                    detail.getBoxType1(), detail.getBoxType2(), detail.getBoxType3(), detail.getAnfme(),
+                    detail.getThreeCode());
             if (DetlDto.has(list, dto)) {
-                DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch(),dto.getBrand(),dto.getStandby1(),dto.getStandby2(),dto.getStandby3(),dto.getBoxType1(),dto.getBoxType2(),dto.getBoxType3());
+                DetlDto detlDto = DetlDto.find(list, dto.getMatnr(), dto.getBatch(), dto.getBrand(), dto.getStandby1(),
+                        dto.getStandby2(), dto.getStandby3(), dto.getBoxType1(), dto.getBoxType2(), dto.getBoxType3());
                 assert detlDto != null;
                 detlDto.setAnfme(detlDto.getAnfme() + detail.getAnfme());
 
-                OrderDetl orderDetl = OrderDetl.find(orderDetlList, dto.getMatnr(), dto.getBatch(),dto.getBrand(),dto.getStandby1(),dto.getStandby2(),dto.getStandby3(),dto.getBoxType1(),dto.getBoxType2(),dto.getBoxType3());
+                OrderDetl orderDetl = OrderDetl.find(orderDetlList, dto.getMatnr(), dto.getBatch(), dto.getBrand(),
+                        dto.getStandby1(), dto.getStandby2(), dto.getStandby3(), dto.getBoxType1(), dto.getBoxType2(),
+                        dto.getBoxType3());
                 assert orderDetl != null;
                 orderDetl.setAnfme(orderDetl.getAnfme() + detail.getAnfme());
             } else {
@@ -116,18 +128,17 @@
                 orderDetlList.add(detail);
             }
         }
-        for (OrderDetl orderDetl : orderDetlList){
+        for (OrderDetl orderDetl : orderDetlList) {
             orderDetl.setWorkQty(0D);
-            OrderInAndOutUtil.insertOrderDetl(order.getPakinPakoutStatus$(),order,orderDetl);
-            //灏忔澗锛氬鏋滀笅鍙戝璐ф淳宸ュ崟锛屽垯鐢熸垚澶囪揣鍑哄簱+澶囪揣鍏ュ簱
-            if (order.getDocType().equals(OrderTypeEnum.TRANSFER.type.longValue())){
+            OrderInAndOutUtil.insertOrderDetl(order.getPakinPakoutStatus$(), order, orderDetl);
+            // 灏忔澗锛氬鏋滀笅鍙戝璐ф淳宸ュ崟锛屽垯鐢熸垚澶囪揣鍑哄簱+澶囪揣鍏ュ簱
+            if (order.getDocType().equals(OrderTypeEnum.TRANSFER.type.longValue())) {
                 try {
-                    ifTransfetInsertStockIn(order,orderDetl);
-                }catch (Exception e){
+                    ifTransfetInsertStockIn(order, orderDetl);
+                } catch (Exception e) {
                     throw new CoolException(e.getMessage());
                 }
             }
-
         }
         // 淇敼璁㈠崟鐘舵�� 1.鏈綔涓� ===>> 2.浣滀笟涓�
         if (!orderService.updateSettle(order.getId(), 2L, null)) {
@@ -137,36 +148,34 @@
     }
 
     @Transactional(rollbackFor = Exception.class)
-    public void ifTransfetInsertStockIn(Order order, OrderDetl orderDetl){
+    public void ifTransfetInsertStockIn(Order order, OrderDetl orderDetl) {
         OrderPakin orderPakin = new OrderPakin();
-        BeanUtils.copyProperties(order,orderPakin);
+        BeanUtils.copyProperties(order, orderPakin);
         orderPakin.setDocType(OrderTypeEnum.STOCK_IN.type.longValue());
 
-        if (!orderPakinService.insert(orderPakin)){
+        if (!orderPakinService.insert(orderPakin)) {
             throw new CoolException("鎻掑叆澶囪揣鍏ュ簱鍗曞け璐�");
         }
         OrderDetlPakin orderDetlPakin = new OrderDetlPakin();
-        BeanUtils.copyProperties(orderDetl,orderDetlPakin);
+        BeanUtils.copyProperties(orderDetl, orderDetlPakin);
         orderDetlPakin.setOrderId(orderPakin.getId());
 
-
-        if (!orderDetlPakinService.insert(orderDetlPakin)){
+        if (!orderDetlPakinService.insert(orderDetlPakin)) {
             throw new CoolException("鎻掑叆澶囪揣鍏ュ簱鍗曞け璐�");
         }
-
 
     }
 
     @Transactional
     public ReturnT<String> startOrderInAndOutUtil(Order order) {
-        //灏忔澗锛氳疆璁埌澶囪揣娲惧伐鍗曟槸鏌ヨ澶囪揣鍏ュ簱鍗曟槸鍚﹀畬鎴�
-        if (order.getDocType().equals(OrderTypeEnum.STOCK_IN.type.longValue())){
+        // 灏忔澗锛氳疆璁埌澶囪揣娲惧伐鍗曟槸鏌ヨ澶囪揣鍏ュ簱鍗曟槸鍚﹀畬鎴�
+        if (order.getDocType().equals(OrderTypeEnum.STOCK_IN.type.longValue())) {
             return SUCCESS;
         }
-        if (order.getDocType().equals(OrderTypeEnum.TRANSFER.type.longValue())){
+        if (order.getDocType().equals(OrderTypeEnum.TRANSFER.type.longValue())) {
             OrderPakin orderPakin = orderPakinService.selectByNo(order.getOrderNo());
             if (null != orderPakin) {
-                if (!orderPakin.getSettle().equals(4L)){
+                if (!orderPakin.getSettle().equals(4L)) {
                     return SUCCESS;
                 }
             }
@@ -176,32 +185,32 @@
             return SUCCESS;
         }
         Order orderSou = orderService.selectByNo(order.getOrderNo());
-        if (!orderSou.getSettle().equals(2L)){
+        if (!orderSou.getSettle().equals(2L)) {
             return FAIL.setMsg("璁㈠崟鐘舵�佷笉姝g‘锛岃鑱旂郴绠$悊鍛�");
         }
         List<OrderDetl> orderDetlList = orderDetlService.selectByOrderId(orderSou.getId());
 
         List<OrderDetl> orderDetls = OrderInAndOutUtil.selectByOrderId(order.getPakinPakoutStatus$(), order.getId());
 
-        for (OrderDetl orderDetlSou : orderDetlList){
-            for (OrderDetl orderDetl : orderDetls){
-                if (orderDetl.getQty().equals(0D)){
+        for (OrderDetl orderDetlSou : orderDetlList) {
+            for (OrderDetl orderDetl : orderDetls) {
+                if (orderDetl.getQty().equals(0D)) {
                     continue;
                 }
-                if (orderDetlSou.beSimilar(orderDetl)){
+                if (orderDetlSou.beSimilar(orderDetl)) {
                     double v = orderDetlSou.getAnfme() - orderDetlSou.getQty();
-                    if (v<orderDetl.getQty() || orderDetl.getQty().equals(v)){
+                    if (v < orderDetl.getQty() || orderDetl.getQty().equals(v)) {
                         orderDetlSou.setQty(orderDetlSou.getAnfme());
                         orderDetl.setQty(orderDetl.getQty() - v);
                         break;
                     } else {
-                        orderDetlSou.setQty(orderDetlSou.getQty()+orderDetl.getQty());
+                        orderDetlSou.setQty(orderDetlSou.getQty() + orderDetl.getQty());
                         orderDetl.setQty(0D);
                     }
                 }
             }
         }
-        for (OrderDetl orderDetlSou : orderDetlList){
+        for (OrderDetl orderDetlSou : orderDetlList) {
             orderDetlService.updateById(orderDetlSou);
         }
         // 淇敼璁㈠崟鐘舵�� 2.浣滀笟涓� ===>> 4.寰呬笂鎶�
@@ -209,18 +218,17 @@
             throw new CoolException("鏈嶅姟鍣ㄥ唴閮ㄩ敊璇紝璇疯仈绯荤鐞嗗憳");
         }
         // 淇敼璁㈠崟鐘舵�� 4.瀹屾垚 ===>> 6.缁撴潫
-        OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(),order.getId(),6L,null);
+        OrderInAndOutUtil.updateOrder(order.getPakinPakoutStatus$(), order.getId(), 6L, null);
         return SUCCESS;
     }
 
-
-
     /**
      * 鍗曟嵁涓婃姤
-     * @author Ryan
-     * @date 2025/12/15 16:14
+     *
      * @param order
      * @return com.zy.asrs.task.core.ReturnT<java.lang.String>
+     * @author Ryan
+     * @date 2025/12/15 16:14
      */
     @Transactional
     public ReturnT<String> startOrderReport(Order order) {
@@ -230,95 +238,146 @@
         }
         long settle = 6L;
         List<OrderDetl> orderDetls = orderDetlService.selectByOrderId(order.getId());
-        // 鍏ュ簱瀹屾垚涓婃姤
-        if (docType.getPakin() == 1) {
-            MesPakinParam pakinParam = new MesPakinParam();
-            pakinParam.setPakinTime(DateUtils.convert(order.getUpdateTime()));
-            pakinParam.setLgortFrom("5008");
-            pakinParam.setLgortTo("5006");
-            for (OrderDetl orderDetl : orderDetls) {
-                if (!orderDetl.getQty().equals(orderDetl.getAnfme())){
-                    settle = 99L;//浜屾鐢熸垚鍗曟嵁
-                }
-                String serial = Cools.isEmpty(orderDetl.getBatch()) ? "" : orderDetl.getBatch();
-                pakinParam.getList().add(new MesPakinParam.Detl(orderDetl.getMatnr() + (Cools.isEmpty(serial) ? "" : "-" + serial), orderDetl.getAnfme()));
-            }
+        if (Integer.valueOf(docType.getDocId() + "").equals(OrderTypeEnum.PICKING.type)) {
+            // 涓婃灦娲惧伐鍗曞畬鎴�
+            ReportOrderParam orderParam = new ReportOrderParam();
+            orderParam.setCompany_id(order.getCstmrName())
+                    .setWms_id(order.getId() + "")
+                    .setOrder_no(order.getOrderNo())
+                    .setType(order.getDocType() + "")
+                    .setInv_no(order.getNumber())
+                    .setPm_tktid(order.getItemName())
+                    .setUpdate_time(Utils.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss"))
+                    .setTarget_location("");
 
-            String response = "";
+            List<ReportOrderParams> reportOrderParams = new ArrayList<>();
+            orderDetls.forEach(detl -> {
+                Mat material = matService.selectByMatnr(detl.getMatnr());
+                if (Objects.isNull(material)) {
+                    throw new CoolException("鐗╂枡涓嶅瓨鍦�");
+                }
+                ReportOrderParams itemParam = new ReportOrderParams();
+                // BS Code
+                itemParam.setTotal_serial(detl.getThreeCode())
+                        // 涓婃姤鏃讹紝榛樿浜у搧绫诲瀷鏄痭ull
+                        .setPro_type(material.getProType())
+                        // 涓婃姤鏃讹紝榛樿浜у搧缂栫爜
+                        .setPro_komcode(detl.getMatnr())
+                        // 涓婃姤鏃讹紝榛樿浜у搧id鏄緵搴斿晢缂栫爜
+                        .setPro_id(detl.getSuppCode())
+                        // 涓婃姤鏃讹紝榛樿鏉ユ簮浣嶇疆鏄痭ull
+                        .setLocation_no(null)
+                        // 涓婃姤鏃讹紝榛樿鐩爣浣嶇疆鏄痭ull
+                        .setLocation_type(null)
+                        // 涓婃姤鏃讹紝榛樿涓婃姤鏃堕棿鏄洿鏂版椂闂�
+                        .setSj_date(order.getUpdateBy().toString())
+                        // 涓婃姤鏃讹紝榛樿涓婃姤浜烘槸鏇存柊浜�
+                        .setSj_emp(order.getUpdateBy$())
+                        // 涓婃姤鏃讹紝榛樿涓婃姤鏁伴噺鏄鍗曟暟閲�
+                        .setPick_qty(detl.getQty().intValue())
+                        // 涓婃姤鏃讹紝榛樿鎹熷潖鏁伴噺鏄�0
+                        .setDamage_qty(0)
+                        // 涓婃姤鏃讹紝榛樿宸紓鏁伴噺鏄�0
+                        .setDiff_qty(0);
+
+                reportOrderParams.add(itemParam);
+            });
+
+            orderParam.setDetails(reportOrderParams);
+
+            XSR response = null;
             boolean success = false;
             try {
-                ReportOrderParam orderParam = new ReportOrderParam();
+                response = kopenApiService.getInDispatchResult(orderParam);
 
-
-
-
-                kopenApiService.getInDispatchResult(orderParam);
-//                response = new HttpHandler.Builder()
-//                        .setUri(MesConstant.URL)
-//                        .setPath(MesConstant.PAKIN_URL)
-//                        .setJson(JSON.toJSONString(pakinParam))
-//                        .build()
-//                        .doPost();
-//                JSONObject jsonObject = JSON.parseObject(response);
-//                if (jsonObject.getInteger("code").equals(200)) {
-                if (true) {
-                    success = true;
-                    // 淇敼璁㈠崟鐘舵�� 4.瀹屾垚 ===>> 6.宸蹭笂鎶�
-                    if (!orderService.updateSettle(order.getId(), settle, null)) {
-                        throw new CoolException("鏈嶅姟鍣ㄥ唴閮ㄩ敊璇紝璇疯仈绯荤鐞嗗憳");
-                    }
-                } else {
-                    log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL+MesConstant.PAKIN_URL, JSON.toJSONString(pakinParam), response);
-                    throw new CoolException("涓婃姤mes绯荤粺澶辫触");
-                }
+                // if (true) {
+                // success = true;
+                // // 淇敼璁㈠崟鐘舵�� 4.瀹屾垚 ===>> 6.宸蹭笂鎶�
+                // if (!orderService.updateSettle(order.getId(), settle, null)) {
+                // throw new CoolException("鏈嶅姟鍣ㄥ唴閮ㄩ敊璇紝璇疯仈绯荤鐞嗗憳");
+                // }
+                // } else {
+                // log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL +
+                // MesConstant.PAKIN_URL, JSON.toJSONString(pakinParam), response);
+                // throw new CoolException("涓婃姤mes绯荤粺澶辫触");
+                // }
             } catch (Exception e) {
                 log.error("fail", e);
-//            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return FAIL.setMsg(e.getMessage());
             } finally {
                 try {
                     // 淇濆瓨鎺ュ彛鏃ュ織
                     apiLogService.save(
-                            "鎴愬搧搴撳叆搴撲笂鎶�",
+                            "涓婃灦娲惧伐鍗曞畬鎴愪笂鎶�",
                             MesConstant.URL + MesConstant.PAKIN_URL,
                             null,
                             "127.0.0.1",
-                            JSON.toJSONString(pakinParam),
-                            response,
-                            success
-                    );
-                } catch (Exception e) { log.error("", e); }
-            }
-        }
-        // 鍑哄簱瀹屾垚涓婃姤
-        if (docType.getPakout() == 1) {
-            MesPakoutParam pakoutParam = new MesPakoutParam();
-            pakoutParam.setTag(!order.getDocType$().equalsIgnoreCase("鎵嬪姩鍑哄簱鍗�"));
-            pakoutParam.setPakoutTime(DateUtils.convert(order.getUpdateTime()));
-            pakoutParam.setLgortFrom("5006");
-            pakoutParam.setLgortTo("1111");
-            if (!pakoutParam.isTag()) {
-                pakoutParam.setKunnr("C1000");
-            }
-            pakoutParam.setOrderNo(order.getOrderNo());
-            for (OrderDetl orderDetl : orderDetls) {
-                if (!orderDetl.getQty().equals(orderDetl.getAnfme())){
-                    settle = 99L;//浜屾鐢熸垚鍗曟嵁
+                            JSON.toJSONString(orderParam),
+                            JSON.toJSONString(response),
+                            success);
+                } catch (Exception e) {
+                    log.error("", e);
                 }
-                String serial = Cools.isEmpty(orderDetl.getBatch()) ? "" : orderDetl.getBatch();
-                pakoutParam.getList().add(new MesPakoutParam.Detl(orderDetl.getMatnr() + (Cools.isEmpty(serial) ? "" : "-" + serial), orderDetl.getAnfme()));
             }
-            String response = "";
+        } else if (Integer.valueOf(docType.getDocId() + "").equals(OrderTypeEnum.TRANSFER.type)) {
+            // 澶囪揣娲惧伐鍗曪紙鍑哄簱锛�
+            ReportOrderParam orderParam = new ReportOrderParam();
+            orderParam.setCompany_id(order.getCstmrName())
+                    .setWms_id(order.getId() + "")
+                    .setOrder_no(order.getOrderNo())
+                    .setType(order.getDocType() + "")
+                    .setInv_no(order.getNumber())
+                    .setPm_tktid(order.getItemName())
+                    .setUpdate_time(Utils.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss"))
+                    .setTarget_location("");
+
+            List<ReportOrderParams> reportOrderParams = new ArrayList<>();
+            orderDetls.forEach(detl -> {
+                Mat material = matService.selectByMatnr(detl.getMatnr());
+                if (Objects.isNull(material)) {
+                    throw new CoolException("鐗╂枡涓嶅瓨鍦�");
+                }
+                ReportOrderParams itemParam = new ReportOrderParams();
+                // BS Code
+                itemParam.setTotal_serial(detl.getThreeCode())
+                        // 涓婃姤鏃讹紝榛樿浜у搧绫诲瀷鏄痭ull
+                        .setPro_type(material.getProType())
+                        // 涓婃姤鏃讹紝榛樿浜у搧缂栫爜
+                        .setPro_komcode(detl.getMatnr())
+                        // 涓婃姤鏃讹紝榛樿浜у搧id鏄緵搴斿晢缂栫爜
+                        .setPro_id(detl.getSuppCode())
+                        // 涓婃姤鏃讹紝榛樿鏉ユ簮浣嶇疆鏄痭ull
+                        .setLocation_no(null)
+                        // 涓婃姤鏃讹紝榛樿鐩爣浣嶇疆鏄痭ull
+                        .setLocation_type(null)
+                        // 涓婃姤鏃讹紝榛樿涓婃姤鏃堕棿鏄洿鏂版椂闂�
+                        .setSj_date(order.getUpdateBy().toString())
+                        // 涓婃姤鏃讹紝榛樿涓婃姤浜烘槸鏇存柊浜�
+                        .setSj_emp(order.getUpdateBy$())
+                        // 涓婃姤鏃讹紝榛樿涓婃姤鏁伴噺鏄鍗曟暟閲�
+                        .setPick_qty(detl.getQty().intValue())
+                        // 涓婃姤鏃讹紝榛樿鎹熷潖鏁伴噺鏄�0
+                        .setDamage_qty(0)
+                        // 涓婃姤鏃讹紝榛樿宸紓鏁伴噺鏄�0
+                        .setDiff_qty(0);
+
+                reportOrderParams.add(itemParam);
+            });
+
+            orderParam.setDetails(reportOrderParams);
+
+            XSR response = null;
             boolean success = false;
             try {
-//                response = new HttpHandler.Builder()
-//                        .setUri(MesConstant.URL)
-//                        .setPath(MesConstant.PAKOUT_URL)
-//                        .setJson(JSON.toJSONString(pakoutParam))
-//                        .build()
-//                        .doPost();
-//                JSONObject jsonObject = JSON.parseObject(response);
-//                if (jsonObject.getInteger("code").equals(200)) {
+                // response = new HttpHandler.Builder()
+                // .setUri(MesConstant.URL)
+                // .setPath(MesConstant.PAKOUT_URL)
+                // .setJson(JSON.toJSONString(pakoutParam))
+                // .build()
+                // .doPost();
+                // JSONObject jsonObject = JSON.parseObject(response);
+                // if (jsonObject.getInteger("code").equals(200)) {
                 if (true) {
                     success = true;
                     // 淇敼璁㈠崟鐘舵�� 4.瀹屾垚 ===>> 6.宸蹭笂鎶�
@@ -326,26 +385,27 @@
                         throw new CoolException("鏈嶅姟鍣ㄥ唴閮ㄩ敊璇紝璇疯仈绯荤鐞嗗憳");
                     }
                 } else {
-                    log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL+MesConstant.PAKOUT_URL, JSON.toJSONString(pakoutParam), response);
+                    log.error("璇锋眰鎺ュ彛澶辫触锛侊紒锛乽rl锛歿}锛況equest锛歿}锛況esponse锛歿}", MesConstant.URL + MesConstant.PAKOUT_URL,
+                            JSON.toJSONString(orderParam), JSON.toJSONString(response));
                     throw new CoolException("涓婃姤mes绯荤粺澶辫触");
                 }
             } catch (Exception e) {
                 log.error("fail", e);
-//            TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return FAIL.setMsg(e.getMessage());
             } finally {
                 try {
                     // 淇濆瓨鎺ュ彛鏃ュ織
                     apiLogService.save(
-                            "鎴愬搧搴撳嚭搴撲笂鎶�",
+                            "澶囪揣娲惧伐鍗曞畬鎴愪笂鎶�",
                             MesConstant.URL + MesConstant.PAKOUT_URL,
                             null,
                             "127.0.0.1",
-                            JSON.toJSONString(pakoutParam),
-                            response,
-                            success
-                    );
-                } catch (Exception e) { log.error("", e); }
+                            JSON.toJSONString(orderParam),
+                            JSON.toJSONString(response),
+                            success);
+                } catch (Exception e) {
+                    log.error("", e);
+                }
             }
         }
         return SUCCESS;
diff --git a/src/main/java/com/zy/asrs/utils/Utils.java b/src/main/java/com/zy/asrs/utils/Utils.java
index 3bcb9d4..1927845 100644
--- a/src/main/java/com/zy/asrs/utils/Utils.java
+++ b/src/main/java/com/zy/asrs/utils/Utils.java
@@ -654,4 +654,15 @@
         return result;
     }
 
+    /**
+     * 鏃ユ湡杞崲涓哄瓧绗︿覆
+     * @param date 鏃ユ湡
+     * @param format 鏍煎紡
+     * @return 瀛楃涓�
+     */
+    public static String dateToStr(Date date, String format) {
+        SimpleDateFormat sdf = new SimpleDateFormat(format);
+        return sdf.format(date);
+    }
+
 }
diff --git a/src/main/resources/mapper/OrderDetlPakoutMapper.xml b/src/main/resources/mapper/OrderDetlPakoutMapper.xml
index 7f70401..fcd4b25 100644
--- a/src/main/resources/mapper/OrderDetlPakoutMapper.xml
+++ b/src/main/resources/mapper/OrderDetlPakoutMapper.xml
@@ -100,6 +100,9 @@
         <if test="matnr!=null and matnr!='' ">
             and mod.matnr like '%' + #{matnr} + '%'
         </if>
+        <if test="doc_type!=null and doc_type!='' ">
+            and mo.doc_type like '%' + #{doc_type} + '%'
+        </if>
         <if test="maktx!=null and maktx!='' ">
             and mod.maktx like '%' + #{maktx} + '%'
         </if>
diff --git a/src/main/resources/mapper/ViewWorkInMapper.xml b/src/main/resources/mapper/ViewWorkInMapper.xml
index 0f5d0cd..043a29e 100644
--- a/src/main/resources/mapper/ViewWorkInMapper.xml
+++ b/src/main/resources/mapper/ViewWorkInMapper.xml
@@ -5,8 +5,8 @@
 
 <!-- mapper涓嶆敮鎸乻ql璇彞宓屽鏃讹紝閲囩敤sql鐗囨鍖呭惈鏂瑰紡锛岃В鍐硏ml鏍囩闂 -->
 <sql id="viewWorkInConditionSql">
-		<if test="loc_no!=null and loc_no!='' ">
-			and loc_no like '%' + #{loc_no} + '%'
+		<if test="locNo!=null and locNo!='' ">
+			and loc_no like '%' + #{locNo} + '%'
 		</if>
 		<if test="matnr!=null and matnr!='' ">
 			and matnr like '%' + #{matnr} + '%'
diff --git a/src/main/webapp/static/js/common.js b/src/main/webapp/static/js/common.js
index e767615..1770a64 100644
--- a/src/main/webapp/static/js/common.js
+++ b/src/main/webapp/static/js/common.js
@@ -246,7 +246,7 @@
     {field: 'matnr', align: 'center',title: '鍟嗗搧缂栧彿', sort:true}
     ,{field: 'maktx', align: 'center',title: '鍟嗗搧鍚嶇О', sort:true}
     ,{field: 'orderNo', align: 'center',title: '鍗曟嵁缂栧彿', hide: false}
-    ,{field: 'standby1', align: 'center',title: '渚涘簲鍟嗙紪鐮�', hide: false}
+    ,{field: 'suppCode', align: 'center',title: '渚涘簲鍟嗙紪鐮�', hide: false}
     ,{field: 'threeCode', align: 'center',title: 'BS Code', hide: false}
     ,{field: 'tag$', align: 'center',title: '闆朵欢绫诲瀷', hide: false}
     ,{field: 'batch', align: 'center',title: '鎵瑰彿', hide: true}
@@ -254,7 +254,7 @@
     ,{field: 'zpallet', align: 'center',title: '鎵樼洏鏉$爜', hide: false}
     ,{field: 'length', align: 'center',title: '閲嶉噺', hide: false}
     ,{field: 'volume', align: 'center',title: '灏哄', hide: false}
-    ,{field: 'modiTime$', align: 'center',title: '鏇存柊鏃堕棿', hide: false}
+    ,{field: 'modiTime', align: 'center',title: '鏇存柊鏃堕棿', hide: false}
     ,{field: 'supp', align: 'center',title: '渚涘簲鍟�', hide: true}
     ,{field: 'specs', align: 'center',title: '瑙勬牸', hide: true}
     ,{field: 'model', align: 'center',title: '浠g爜', hide: true}
diff --git a/src/main/webapp/static/js/report/workIn.js b/src/main/webapp/static/js/report/workIn.js
index ec329f9..c774179 100644
--- a/src/main/webapp/static/js/report/workIn.js
+++ b/src/main/webapp/static/js/report/workIn.js
@@ -1,8 +1,8 @@
 var pageCurr;
 function getCol() {
     var cols = [
-        {field: 'ioTime$', align: 'center', title: '鍏ュ簱鏃ユ湡', width: 200}
-        ,{field: 'loc_no', align: 'center',title: '搴撲綅鍙�'}
+        {field: 'ioTime', align: 'center', title: '鍏ュ簱鏃ユ湡', width: 200}
+        ,{field: 'locNo', align: 'center',title: '搴撲綅鍙�'}
     ];
     cols.push.apply(cols, detlCols);
     return cols;
diff --git a/src/main/webapp/views/report/viewWorkIn.html b/src/main/webapp/views/report/viewWorkIn.html
index b0caa2e..cf28bc6 100644
--- a/src/main/webapp/views/report/viewWorkIn.html
+++ b/src/main/webapp/views/report/viewWorkIn.html
@@ -21,7 +21,7 @@
 <div id="search-box" class="layui-form layui-card-header">
     <div class="layui-inline">
         <div class="layui-input-inline">
-            <input class="layui-input" type="text" name="loc_no" placeholder="搴撲綅鍙�" autocomplete="off">
+            <input class="layui-input" type="text" name="locNo" placeholder="搴撲綅鍙�" autocomplete="off">
         </div>
     </div>
     <div class="layui-inline">

--
Gitblit v1.9.1