Bläddra i källkod

'出库修改'

Tiroble 3 år sedan
förälder
incheckning
e8c357837d

+ 11 - 5
src/main/java/com/steerinfo/dil/controller/WmspOutboundResultController.java

@@ -192,6 +192,10 @@ public class WmspOutboundResultController extends BaseRESTfulController {
         int isScan = wmspOutboundResultService.ExistScanResult(subResultMaterial);
         //判断物资是否是需要出库的物资,需要出库物资数量不等于0,通过物资唯一编码和出库实绩
         Map<String,Object> materialMap = wmspOutboundResultMaterialService.isOutboundResultMaterial(MaterialOnlyCode,resultId);
+        if (materialMap==null){
+            //物质类型错误
+            return failed(-4);
+        }
         Integer materialNumber= Integer.valueOf(materialMap.get("materailNumber").toString());
         //获得已经扫描的物质数量
         int scanCount = wmspOutboundScanResultService.getScanCount(MaterialOnlyCode,resultId);
@@ -208,17 +212,19 @@ public class WmspOutboundResultController extends BaseRESTfulController {
             int status= wmspOutboundResultService.createOutboundScanResult(subResultMaterial,personnelId,resultId,(BigDecimal)map1.get("inboundResultId"),new BigDecimal(materialMap.get("resultMaterialId").toString()));
             return success(status);
         }else {
-            if (isScan>0){
-                //重复扫描
-                return failed(-1);
-            }
+
             if (list.size()==0){
                 //没有入库
                 return failed(-2);
             }else {
+                if (isScan>0){
+                    //重复扫描
+                    return failed(-1);
+                }
                 //货物已满
                 return failed(-3);
             }
+
         }
     }
     /**
@@ -447,7 +453,7 @@ public class WmspOutboundResultController extends BaseRESTfulController {
         if(result == 2){
             return success(2,"该订单已出库");
         }
-        return success();
+        return failed(result);
     }
     @ApiOperation(value = "出库(非0:成功,0:失败)")
     @PostMapping("/outbountResultToSuccess2")

+ 1 - 1
src/main/resources/bootstrap.yml

@@ -1,7 +1,7 @@
 api.version: api/v1/wms
 spring:
   profiles:
-    include: ${SPRING_PROFILES:prod}
+    include: ${SPRING_PROFILES:dev}
   jackson:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8

+ 4 - 2
src/main/resources/com/steerinfo/dil/mapper/WmspInboundScanResultMapper.xml

@@ -1068,8 +1068,10 @@ where wisr.result_id = #{stackResultId}
 <!--    根据物资Id查询相对应的入库实绩ID-->
     <select id="getInboundResultIdByMaterial" resultType="java.util.LinkedHashMap">
         SELECT wisr.INBOUND_RESULT_ID "inboundResultId"
-        FROM WMSP_INBOUND_SCAN_RESULT wisr
-        WHERE wisr.RESULT_MATERIAL = #{subResultMaterial}
+        from wmsp_inbound_scan_result wisr
+        left join wmsp_grid_material wgm
+        on wisr.material_id=wgm.material_id
+        where wgm.deleted=0 and wisr.RESULT_MATERIAL = #{subResultMaterial}
     </select>