Tiroble пре 3 година
родитељ
комит
e0e3f00084

+ 2 - 1
src/main/java/com/steerinfo/dil/controller/WmsInboundResultController.java

@@ -161,11 +161,12 @@ public class WmsInboundResultController extends BaseRESTfulController {
                     int status2= wmsInboundResultServiceImpl.updateInboundStatus(new BigDecimal(conditionMap.get("distributeId").toString()));
                 }
             }
+               int status3= wmspInboundDistributeService.updateDistributeStatus(conditionMap.get("distributeId").toString());
                 return success("下发成功");
         //第n批第一次提交
         }else{
             //需要判断是否已经提交过了 通过resultId判断物质是否已经下发过了跳出、多次下发的结果
-            Integer resultStatus= wmsInboundScanResultServiceImpl.getResultStatusByResultId(mapList.get(0).get("resultId").toString());
+            int resultStatus= wmsInboundScanResultServiceImpl.getResultStatusByResultId(mapList.get(0).get("resultId").toString());
            if(resultStatus==1){
                return success("请勿重复下发");
            }

+ 2 - 0
src/main/java/com/steerinfo/dil/mapper/WmspInboundDistributeMapper.java

@@ -14,4 +14,6 @@ public interface WmspInboundDistributeMapper extends IBaseMapper<WmspInboundDist
     Integer getDistributeStatus(Object distributeId);
 
     Integer grabDistribute(Map<String, Object> mapValue);
+
+    int updateDistributeStatus(String distributeId);
 }

+ 2 - 0
src/main/java/com/steerinfo/dil/service/IWmspInboundDistributeService.java

@@ -30,4 +30,6 @@ public interface IWmspInboundDistributeService extends IBaseService<WmspInboundD
 
     //    对展示的list集合进行处理
     List<Map<String ,Object>> getInboundList(List<Map<String ,Object>> list);
+
+    int updateDistributeStatus(String distributeId);
 }

+ 6 - 1
src/main/java/com/steerinfo/dil/service/impl/WmspInboundDistributeServiceImpl.java

@@ -84,7 +84,7 @@ public class WmspInboundDistributeServiceImpl extends BaseServiceImpl<WmspInboun
         //判断这一批是否被其他人抢了
         Integer status= wmspInboundDistributeMapper.getDistributeStatus(mapValue.get("distributeId"));
         //如果没有被抢就设置位当前用户得单
-        if (status==1){
+        if (status==2){
             return wmspInboundDistributeMapper.grabDistribute(mapValue);
         }
         return 0;
@@ -148,4 +148,9 @@ public class WmspInboundDistributeServiceImpl extends BaseServiceImpl<WmspInboun
 //        返回过滤之后的list
         return result2;
     }
+
+    @Override
+    public int updateDistributeStatus(String distributeId) {
+        return wmspInboundDistributeMapper.updateDistributeStatus(distributeId);
+    }
 }

+ 6 - 2
src/main/resources/com/steerinfo/dil/mapper/WmspInboundDistributeMapper.xml

@@ -410,13 +410,17 @@
   left join rms_material_steel rms on rms.MATERIAL_STEEL_ID=wir.material_Id
   left join rms_material rm on rm.material_Id=rms.material_Id
    where wir.INBOUND_DISTRIBUTE_ID in(  select * from(
-           select DISTRIBUTE_ID  from  WMSP_INBOUND_DISTRIBUTE where  RESULT_STATUS=1  and PERSONNEL_WORKSHOPID=#{personnelWorkshopid} order by insert_time asc
+           select DISTRIBUTE_ID  from  WMSP_INBOUND_DISTRIBUTE where  RESULT_STATUS=2  and PERSONNEL_WORKSHOPID=#{personnelWorkshopid} order by insert_time asc
     ) where rownum=1)
   </select>
   <select id="getDistributeStatus" resultType="java.lang.Integer">
        select RESULT_STATUS  from  WMSP_INBOUND_DISTRIBUTE where DISTRIBUTE_ID=#{distributeId}
   </select>
   <update id="grabDistribute">
-    update WMSP_INBOUND_DISTRIBUTE set DRIVING_ID=#{drivingId} , RESULT_STATUS='2' where DISTRIBUTE_ID=#{distributeId}
+    update WMSP_INBOUND_DISTRIBUTE set DRIVING_ID=#{drivingId} , RESULT_STATUS='3' where DISTRIBUTE_ID=#{distributeId}
+  </update>
+  <update id="updateDistributeStatus">
+     update WMSP_INBOUND_DISTRIBUTE
+        set RESULT_STATUS=2 where DISTRIBUTE_ID=#{distributeId}
   </update>
 </mapper>