Browse Source

修改代码

Tiroble 3 years ago
parent
commit
34fec5a1ae

+ 12 - 4
src/main/java/com/steerinfo/dil/controller/WmspOutboundResultController.java

@@ -6,6 +6,7 @@ import com.steerinfo.dil.mapper.WmspInboundScanResultMapper;
 import com.steerinfo.dil.model.WmspOutboundResult;
 import com.steerinfo.dil.model.WmspOutboundScanResult;
 import com.steerinfo.dil.service.IWmspOutboundResultMaterialService;
+import com.steerinfo.dil.service.impl.WmsInboundScanResultServiceImpl;
 import com.steerinfo.dil.service.impl.WmspOutboundResultServiceImpl;
 import com.steerinfo.dil.service.impl.WmspOutboundScanResultServiceImpl;
 import com.steerinfo.dil.util.BaseRESTfulController;
@@ -23,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.HashMap;
@@ -46,6 +48,8 @@ import java.util.Map;
 @RequestMapping("/${api.version}/wmspoutboundresults")
 public class WmspOutboundResultController extends BaseRESTfulController {
 
+    @Autowired
+    WmsInboundScanResultServiceImpl wmsInboundScanResultService;
     @Autowired
     private WmspOutboundResultServiceImpl wmspOutboundResultService;
     @Autowired
@@ -178,7 +182,7 @@ public class WmspOutboundResultController extends BaseRESTfulController {
      * */
     @Transactional
     @PostMapping(value = "/insertwmspOutboundScanResult")
-    public synchronized RESTfulResult insertwmspOutboundScanResult(@RequestBody(required = false) Map<String, Object> map){
+    public synchronized RESTfulResult insertwmspOutboundScanResult(@RequestBody(required = false) Map<String, Object> map) throws ParseException {
         //判断物资是否满足要求,目前一下三种不做处理的判断
         //获取装卸工扫描吊牌结果   HRB400-14-21706854-9-3049-280-20211001015115-7a63cd87a4095e7f-08010103010100003-4
         String subResultMaterial = map.get("resultMaterial").toString().substring(0,map.get("resultMaterial").toString().length() - 1);
@@ -194,10 +198,14 @@ public class WmspOutboundResultController extends BaseRESTfulController {
         //根据物资id查询相对应的入库实绩ID,并将其赋值给相对应的入库扫描实绩表,判断是否入库
         List<Map<String, Object>> list = wmspInboundScanResultMapper.getInboundResultIdByMaterial(subResultMaterial);
         if (list==null||list.size()==0){
-            //没有入库
-            return failed(-2);
+            Map<String, Object> inboundScanResultByResultMaterial = wmsInboundScanResultService.createInboundScanResultByResultMaterial(1, map.get("personnelJobNumber").toString(), map.get("resultMaterial").toString());
+            if (inboundScanResultByResultMaterial==null){
+                //没有入库
+                return failed(-2);
+            }
+
         }
-        //判断物资是否是需要出库的物资,需要出库物资数量不等于0,通过物资唯一编码和出库实绩
+        //判断物资是否是需要出库的物资类型,需要出库物资数量不等于0,通过物资唯一编码和出库实绩
         Map<String,Object> materialMap = wmspOutboundResultMaterialService.isOutboundResultMaterial(MaterialOnlyCode,resultId);
         if (materialMap==null){
             //物质类型错误

+ 1 - 2
src/main/java/com/steerinfo/dil/service/impl/WmspOutboundResultServiceImpl.java

@@ -342,7 +342,7 @@ public class WmspOutboundResultServiceImpl  implements IWmspOutboundResultServic
         outBoundDetailed.setOutBoundTypeDetailedInfos(outBoundTypeDetailedInfos);
         return outBoundDetailed;
     }
-
+    @Transactional
     @Override
     public int createOutboundScanResult(String resultMaterial, BigDecimal personnelId, BigDecimal resultId,BigDecimal inboundResultId,BigDecimal resultMaterialId) {
         //截取扫描结果,得到物资唯一编码
@@ -426,7 +426,6 @@ public class WmspOutboundResultServiceImpl  implements IWmspOutboundResultServic
         //查询提货单,没有确定出库物资类型集合
         List<OutBoundTypeDetailedInfo> outBoundTypeDetailedInfos= wmspOutboundResultMaterialService.getOutBoundTypeDetailedInfo(resultId,1);
         //查询出库扫描实绩,并且在实时库存没有删除的出库扫描实绩
-
         //查询扫码实绩的扫码结构
         List<String> onlycodes= wmspOutboundScanResultService.getOutBoundScanResultOnlyCodes(resultId);
         //出库信息展示