自动化立体仓库 - WMS系统
lty
1 天以前 2ede5469ff64257e97ab92825261afeb643d7b82
#订单出库agv库位锁定,取消,配置
6个文件已修改
72 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/service/impl/BasDevpServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/web/WcsController.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/WrkMastMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/wrkMast/wrkMast.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/BasDevpServiceImpl.java
@@ -52,9 +52,9 @@
            if(station.getAutoing()==null || !station.getAutoing().equals("Y")) {
                throw new CoolException(devpNo+"站点不是自动状态");
            }
            if(station.getLoading()==null || !station.getLoading().equals("Y")) {
                throw new CoolException(devpNo+"站点无物");
            }
//            if(station.getLoading()==null || !station.getLoading().equals("Y")) {
//                throw new CoolException(devpNo+"站点无物");
//            }
            if(station.getWrkNo()!=null && station.getWrkNo()>0 && station.getWrkNo() < 9990) {
                throw new CoolException(devpNo+"站点已有工作号");
            }
src/main/java/com/zy/asrs/service/impl/WorkServiceImpl.java
@@ -23,6 +23,8 @@
import com.zy.common.properties.SlaveProperties;
import com.zy.common.service.CommonService;
import com.zy.common.web.WcsController;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -73,6 +75,8 @@
    private OrderService orderService;
    @Autowired
    private OrderDetlService orderDetlService;
    @Autowired
    private ConfigService configService;
    @Autowired
    private WcsController wcsController;
    @Autowired
@@ -397,6 +401,8 @@
                throw new CoolException("订单出库异常,请联系管理员");
            }
        }
        Config config = configService.selectConfigByCode("AutoMPArea");
        // 获取库位
        LocMast locMast = locMastService.selectById(taskDto.getLocNo());
        // 判断是否是盘点单
@@ -404,6 +410,16 @@
        OrderPakout orderPakout = orderPakOutService.selectByNo(orderNo);
        int ioType = orderPakout.getDocType() == 8 ? 107 : (taskDto.isAll() ? 101 : 103);
        StaDesc staDesc = staDescService.queryCrnStnAuto(ioType, locMast.getCrnNo(), staNo.getDevNo());
        List<LocMast> list = locMastMapper.selectList(
                new EntityWrapper<LocMast>()
                        .eq("whs_type", 5)
                        .eq("loc_sts", "O")
        );
        LocMast locMastRgv = list.isEmpty() ? null : list.get(0);
        // 生成工作号
        int workNo = commonService.getWorkNo(WorkNoType.getWorkNoType(ioType));
        // 生成工作档
@@ -417,6 +433,10 @@
        wrkMast.setSourceStaNo(staDesc.getCrnStn()); // 源站
        wrkMast.setStaNo(staDesc.getStnNo()); // 目标站
        wrkMast.setSourceLocNo(taskDto.getLocNo()); // 源库位
        if (Boolean.parseBoolean(config.getValue()) && locMastRgv.getLocNo() != null) {  //若有空库位且配置允许则绑定其备料库位号
            wrkMast.setLocNo(locMastRgv.getLocNo());
            wrkMast.setTakeNone("0");  //0rgv未取,1rgv已取货
        }
        wrkMast.setFullPlt("Y"); // 满板:Y
        wrkMast.setPicking("N"); // 拣料
        wrkMast.setExitMk("N"); // 退出
@@ -466,6 +486,18 @@
                    orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3()
                    , locDto.getAnfme());
            OrderInAndOutUtil.updateOrder(Boolean.FALSE,orderDetl.getOrderId(), 2L, userId);
        }
        //修改agv备料区状态
        if(locMastRgv.getLocSts().equals("O")){
            locMastRgv.setLocSts("S");
            locMastRgv.setModiUser(userId);
            locMastRgv.setModiTime(now);
            if (!locMastService.updateById(locMastRgv)) {
                throw new CoolException("预约agv备料区库位状态失败,库位号:"+taskDto.getLocNo());
            }
        }else{
            throw new CoolException(taskDto.getLocNo() + "备料区不是空库位状态");
        }
        // 修改库位状态:   F.在库 ====>>> R.出库预约/P.拣料/盘点/并板出库中
        locMast = locMastService.selectById(taskDto.getLocNo());
@@ -1128,6 +1160,16 @@
        //取消出库工作档时,查询单据管理表,回滚作业中数量
        if(wrkMast.getIoType() == 101 || wrkMast.getIoType() == 103) {
            List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo());
            if(wrkMast.getLocNo() != null){
                LocMast locMast = locMastService.selectById(wrkMast.getLocNo());
                locMast.setLocSts("O");
                locMast.setModiTime(now);
                locMast.setModiUser(userId);
                boolean locMastRes = locMastService.updateById(locMast);
                if (!locMastRes) {
                    throw new CoolException("保存数据失败");
                }
            }
            for (WrkDetl wrkDetl : wrkDetls) {
                if (!Cools.isEmpty(wrkDetl.getOrderNo())) {
//                    if (!orderDetlService.decrease(wrkDetl.getOrderNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getAnfme())) {
src/main/java/com/zy/common/web/WcsController.java
@@ -162,12 +162,14 @@
        // 源站点状态检测
        BasDevp sourceStaNo = basDevpService.checkSiteStatus(transplantWork.getStaNo(), true);
        WrkMast wrkMast1 = wrkMastService.selectWrkMast(transplantWork.getWorkNo(),transplantWork.getBarcode());
        if(sourceStaNo ==null ){
            return R.error("该站点盘点移栽许可,请查看源站点状态检测");
        }
        if(wrkMast1== null){
            return  R.error("无该盘点移栽任务");
        }
        List<WrkDetl> wrkDetls = wrkDetlService.selectByWrkNo(transplantWork.getWorkNo());
        Date now = new Date();
        // 生成工作档
        WrkMast wrkMast = new WrkMast();
        wrkMast.setWrkNo(9997);
@@ -208,6 +210,9 @@
        // 源站点状态检测
        BasDevp sourceStaNo = basDevpService.checkSiteStatus(transplantWork.getStaNo(), true);
        WrkMast wrkMast1 = wrkMastService.selectWrkMast(transplantWork.getWorkNo(),transplantWork.getBarcode());
        if(sourceStaNo == null){
        }
        if(wrkMast1== null){
            return  R.error("无该盘点移栽任务");
        }
src/main/resources/application.yml
@@ -1,5 +1,5 @@
server:
  port: 8080
  port: 8888
  servlet:
    context-path: /@pom.build.finalName@
src/main/resources/mapper/WrkMastMapper.xml
@@ -69,7 +69,7 @@
    <select id="selectToBeHistoryData" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where wrk_sts=5
        or (wrk_sts=15 and ove_mk='Y' and wrk_no not in (select wrk_no from asr_bas_devp) and wrk_no not in (select wrk_no from asr_wrk_mast_sta))
        or (wrk_sts=15 and take_none = '1' and ove_mk='Y' and wrk_no not in (select wrk_no from asr_bas_devp) and wrk_no not in (select wrk_no from asr_wrk_mast_sta))
        or (wrk_sts=15 and dateadd(mi,3,crn_end_time) &lt;= getdate() and wrk_no not in (select wrk_no from asr_bas_devp))
        or (wrk_sts=15 and crn_end_time is null and wrk_no not in (select wrk_no from asr_bas_devp))
        order by io_time,wrk_no asc
src/main/webapp/static/js/wrkMast/wrkMast.js
@@ -32,7 +32,18 @@
            ,{field: 'locNo$', align: 'center',title: '目标库位'}
            ,{field: 'barcode', align: 'center',title: '条码'}
            ,{field: 'preHave', align: 'center',title: '先入品', hide: true}
            ,{field: 'takeNone', align: 'center',title: '空操作', hide: true}
            ,{field: 'takeNone', align: 'center', title: 'AGV锁定',
                templet: function(d){
                    if(d.takeNone === "0"){
                        return "未取货";
                    } else if(d.takeNone === "1"){
                        return "已取货";
                    } else {
                        return "";
                    }
                }
            }
            // ,{field: 'picking', align: 'center',title: '拣料', templet:function(row){
            //         var html = "<input value='picking' type='checkbox' lay-skin='primary' lay-filter='tableCheckbox' table-index='"+row.LAY_TABLE_INDEX+"'";
            //         if(row.picking === 'Y'){html += " checked ";}