自动化立体仓库 - WMS系统
#
Junjie
5 天以前 69c997d31073a2a8370dd764138f7ef208804a49
#
3个文件已修改
2个文件已添加
110 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/MobileController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/param/PalletToAllOutParam.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/param/PalletToOutStaParam.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/MobileService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/MobileController.java
@@ -698,4 +698,18 @@
        return R.ok("上报ERP成功");
    }
    @RequestMapping("/pallet/toOutSta")
    @ManagerAuth(memo = "托盘去出库口")
    public R toOutSta(@RequestBody PalletToOutStaParam param) {
        mobileService.toOutSta(param, getUserId());
        return R.ok();
    }
    @RequestMapping("/pallet/toAllOut")
    @ManagerAuth(memo = "拣料转全板")
    public R toAllOut(@RequestBody PalletToAllOutParam param) {
        mobileService.toAllOut(param, getUserId());
        return R.ok();
    }
}
src/main/java/com/zy/asrs/entity/param/PalletToAllOutParam.java
New file
@@ -0,0 +1,14 @@
package com.zy.asrs.entity.param;
import lombok.Data;
@Data
public class PalletToAllOutParam {
    // 托盘条码
    private String barcode;
    // 托盘条码
    private String newBarcode;
}
src/main/java/com/zy/asrs/entity/param/PalletToOutStaParam.java
New file
@@ -0,0 +1,11 @@
package com.zy.asrs.entity.param;
import lombok.Data;
@Data
public class PalletToOutStaParam {
    // 托盘条码
    private String barcode;
}
src/main/java/com/zy/asrs/service/MobileService.java
@@ -74,4 +74,8 @@
                  Double curOutQty, Integer ioType, Long userId, Date now);
    void checkOutSubmit(Integer orderId, Long userId);
    void toOutSta(PalletToOutStaParam param, Long userId);
    void toAllOut(PalletToAllOutParam param, Long userId);
}
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -19,10 +19,11 @@
import com.zy.common.model.DetlDto;
import com.zy.common.model.enums.WorkNoType;
import com.zy.common.service.CommonService;
import com.zy.common.utils.Synchro;
import com.zy.common.utils.HttpHandler;
import com.zy.nc.service.NccJcQilibcBarcodeflowWmsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -38,6 +39,9 @@
@Slf4j
@Service
public class MobileServiceImpl implements MobileService {
    @Value("${wcs.url}")
    private String wcsUrl;
    @Autowired
    private MatService matService;
@@ -1264,4 +1268,65 @@
            throw new CoolException("盘点未完成无法上报");
        }
    }
    @Override
    public void toOutSta(PalletToOutStaParam param, Long userId) {
        WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode());
        if (wrkMast == null) {
            throw new CoolException("工作档不存在");
        }
        if (wrkMast.getIoType() != 103) {
            throw new CoolException("工作档类型不是拣料出库");
        }
        if (wrkMast.getWrkSts() != 14) {
            throw new CoolException("工作状态未处于已出库");
        }
        String response = "";
        try {
            HashMap<String, Object> map = new HashMap<>();
            map.put("wrkNo", wrkMast.getWrkNo());
            map.put("sourceStaNo", wrkMast.getStaNo());
            map.put("staNo", 1075);
            response = new HttpHandler.Builder()
                    .setUri(wcsUrl)
                    .setPath("/open/toOutSta")
                    .setJson(JSON.toJSONString(map))
                    .build()
                    .doPost();
            log.info("toOutSta:{}", response);
        } catch (Exception e) {
            log.error("fail", e);
        }
    }
    @Override
    public void toAllOut(PalletToAllOutParam param, Long userId) {
        WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode());
        if (wrkMast == null) {
            throw new CoolException("工作档不存在");
        }
        if (wrkMast.getIoType() != 103) {
            throw new CoolException("工作档类型不是拣料出库");
        }
        if (wrkMast.getWrkSts() != 14) {
            throw new CoolException("工作状态未处于已出库");
        }
        wrkMast.setBarcode(param.getNewBarcode());
        wrkMast.setModiTime(new Date());
        wrkMast.setModiUser(userId);
        wrkMastService.updateById(wrkMast);
        WrkDetl wrkDetl = new WrkDetl();
        wrkDetl.setZpallet(param.getNewBarcode());
        wrkDetl.setModiTime(new Date());
        wrkDetl.setModiUser(userId);
        wrkDetlService.update(wrkDetl, new EntityWrapper<WrkDetl>().eq("wrk_no", wrkMast.getWrkNo()));
    }
}