|
@@ -253,6 +253,77 @@ public class WmsInboundResultController extends BaseRESTfulController {
|
|
|
return success(pageList);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ * 新增入库实绩
|
|
|
+ *
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation("新增入库实绩")
|
|
|
+ @PostMapping("/insertInboundResult4")
|
|
|
+ @Transactional
|
|
|
+ public RESTfulResult addInvoice2(@RequestParam("userName") String userName,@RequestParam("groupId") BigDecimal groupId,@RequestParam("personnelWorkshopid") BigDecimal personnelWorkshopid, @RequestBody(required = false) List<Map<String, Object>> mapList) {
|
|
|
+
|
|
|
+
|
|
|
+ int batch=0;
|
|
|
+
|
|
|
+ int resultStatus= wmsInboundScanResultServiceImpl.getResultStatusByResultId(mapList.get(0).get("resultId").toString());
|
|
|
+ if(resultStatus==1){
|
|
|
+ return success("请勿重复下发");
|
|
|
+ }
|
|
|
+
|
|
|
+ WmspInboundDistribute wmspInboundDistribute=wmspInboundDistributeService.initAndCreateInboundDistribute(personnelWorkshopid,groupId,userName,batch);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ for (int i=0;i<mapList.size();i++){
|
|
|
+ BigDecimal count = wmsInboundScanResultService.selectMaterialTypeByMaterialId(new BigDecimal(mapList.get(0).get("materialId").toString()));
|
|
|
+ if (count!=null){
|
|
|
+ Map<String,Object> item=mapList.get(i);
|
|
|
+
|
|
|
+ BigDecimal houseGrid = null;
|
|
|
+ if (personnelWorkshopid.compareTo(new BigDecimal(1))==0){
|
|
|
+ houseGrid = new BigDecimal("12335");
|
|
|
+ }else if (personnelWorkshopid.compareTo(new BigDecimal(2))==0){
|
|
|
+ houseGrid = new BigDecimal("24472");
|
|
|
+ }
|
|
|
+
|
|
|
+ WmspInboundResult wmspInboundResult = wmsInboundResultServiceImpl.initAndWmspInboundResult(1,i+1,personnelWorkshopid,groupId,userName,wmspInboundDistribute.getDistributeId(),houseGrid,item);
|
|
|
+
|
|
|
+ int status= wmsInboundScanResultServiceImpl.updateInboundScanStatus(new BigDecimal(item.get("resultId").toString()),wmspInboundResult.getInboundId());
|
|
|
+
|
|
|
+ wmspGridMaterialService.initInsertWmspGridMaterial(item,houseGrid);
|
|
|
+
|
|
|
+
|
|
|
+ if(mapList.size()==i+1){
|
|
|
+ int status2= wmsInboundResultServiceImpl.updateInboundStatus(wmspInboundDistribute.getDistributeId());
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+
|
|
|
+
|
|
|
+ Map<String, Object> item = mapList.get(i);
|
|
|
+
|
|
|
+ HashMap<String, Object> map3 = new HashMap<>();
|
|
|
+ map3.put("warehouseId",3);
|
|
|
+ BigDecimal houseGrid=rmsPwarehouseGridService.getGridId(map3);;
|
|
|
+
|
|
|
+ WmspInboundResult wmspInboundResult = wmsInboundResultServiceImpl.initAndWmspInboundResult(1, i + 1, personnelWorkshopid, new BigDecimal(0), userName, wmspInboundDistribute.getDistributeId(), houseGrid, item);
|
|
|
+
|
|
|
+ int status = wmsInboundScanResultServiceImpl.updateInboundScanStatus(new BigDecimal(item.get("resultId").toString()), wmspInboundResult.getInboundId());
|
|
|
+
|
|
|
+ wmspGridMaterialService.initInsertWmspGridMaterial(item, houseGrid);
|
|
|
+
|
|
|
+ if(mapList.size()==i+1){
|
|
|
+ int status2= wmsInboundResultServiceImpl.updateInboundStatus(wmspInboundDistribute.getDistributeId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ int status3= wmspInboundDistributeService.updateDistributeStatus(wmspInboundDistribute.getDistributeId().toString());
|
|
|
+ }
|
|
|
+ return success("下发成功");
|
|
|
+ }
|
|
|
|
|
|
* 新增入库实绩
|
|
|
*
|