自动化立体仓库 - WMS系统
#
zyx
2024-05-14 6c3d4d0530fd8f64e6fc92b996ec724eba316e94
src/main/java/com/zy/asrs/controller/MobileController.java
@@ -22,6 +22,7 @@
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.text.ParseException;
import java.util.*;
/**
@@ -58,6 +59,8 @@
    private PlaService plaService;
    @Autowired
    private NodeService nodeService;
    @Autowired
    private OpenService openService;
    // 商品上架
@@ -424,7 +427,8 @@
    @RequestMapping("/plaDetl/packin/v1")
    //@ManagerAuth(memo="pla入库")
    public R plaPackIn(@RequestBody JSONObject json){
    @Transactional
    public R plaPackIn(@RequestBody JSONObject json) throws ParseException {
        String locNo = json.get("locNo").toString();
        JSONArray jsonArray = JSONArray.parseArray(json.getJSONArray("pla").toJSONString());
        for (Object o : jsonArray){
@@ -442,6 +446,34 @@
                mobileService.plaPakin(brand,locNo,batch,packageNo,user);
            }
        }
        //入库成功后上报ERP
        //openService.pakinReportErp(json);
        return R.ok("入库成功");
    }
    @RequestMapping("/plaDetl/packin/v2")
    //@ManagerAuth(memo="pla入库")
    @Transactional
    public R plaPackInTestErp(@RequestBody JSONObject json) throws ParseException {
        String locNo = json.get("locNo").toString();
        JSONArray jsonArray = JSONArray.parseArray(json.getJSONArray("pla").toJSONString());
        for (Object o : jsonArray){
            JSONObject jsonObject = (JSONObject)o;
            String brand = jsonObject.get("brand").toString();
            String batch = jsonObject.get("batch").toString();
            Integer packageNo = Integer.parseInt(jsonObject.get("packageNo").toString());
            if(Cools.isEmpty(locNo) || Cools.isEmpty(batch) || Cools.isEmpty(packageNo)){
                return R.error("有参数为空,无法入库");
            }
            //测试
            if(true){
                User user = new User();
                user.setUsername("test");
                mobileService.plaPakin(brand,locNo,batch,packageNo,user);
            }
        }
        //入库成功后上报ERP
        openService.pakinReportErp(json);
        return R.ok("入库成功");
    }