自动化立体仓库 - WMS系统
zwl
2025-07-08 3ad65283c54059e0c61110589fb19398ac3525fe
src/main/java/com/zy/asrs/task/ERPReportScheduler.java
@@ -27,8 +27,10 @@
    @Value("${erp.address.URL}")
    private String URL;
    @Value("${erp.address.outaddress}")
    private String outAddress;
    @Value("${erp.address.outReportAddress}")
    private String outReportAddress;
    @Value("${erp.address.inReportAddress}")
    private String inReportAddress;
    @Autowired
    private OrderDetlService orderDetlService;
    @Autowired
@@ -49,7 +51,7 @@
     * 单个任务上报erp
     */
    @Scheduled(cron = "0/10 * * * * ? ")
    private void execute() {
    private synchronized void execute() {
        //查找所有任务档任务状态为40ERP上报中的任务
        List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", 40));
@@ -81,13 +83,22 @@
                        map.put("itemNo",orderDetl.getMatnr());
                        map.put("qty",wrkDetl.getAnfme());
                        map.put("unitNo",orderDetl.getUnit());
                        map.put("warehouseNo",orderDetl.getColor());
                        map.put("warehouseNo","02201");
                        map.put("cellNo",orderDetl.getBrand());
                        map.put("combinationLotNo",String.valueOf(orderDetl.getBatch()));
                        map.put("barcode",wrkDetl.getZpallet());
                        map.put("barcode",wrkDetl.getMatnr());
                        datas.add(map);
                    }
                    String path= "";
                    String work= "";
                    if(wrkMast.getIoType()<100){
                        path=inReportAddress;
                        work="入库";
                    }else{
                        path=outReportAddress;
                        work="出库";
                    }
                    path=outReportAddress;
                    HashMap<String,Object> map=new HashMap<>();
                    map.put("data",datas);
                    //上报ERP
@@ -96,7 +107,7 @@
                    try {
                        response = new HttpHandler.Builder()
                                .setUri(URL)
                                .setPath(outAddress)
                                .setPath(path)
                                .setJson(JSON.toJSONString(map))
                                .build()
                                .doPost();
@@ -107,6 +118,7 @@
                            }else{
                                wrkMast.setWrkSts(18L);//出库转历史档
                            }
                            wrkMastService.updateById(wrkMast);
                        } else {
                            log.error("任务号={},上报失败",wrkMast.getWrkNo());
                        }
@@ -116,8 +128,8 @@
                        try {
                            // 保存接口日志
                            apiLogService.save(
                                    "上报任务结果给ERP",
                                    URL + outAddress,
                                    "上报"+work+"任务结果给ERP",
                                    URL + path,
                                    null,
                                    "127.0.0.1",
                                    map.toString(),