| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("siteId", siteId); |
| | | map.put("desc", siteId + "(全板出库口)"); |
| | | if(siteId == 1071) { |
| | | map.put("desc", siteId + "(一号灌装线)"); |
| | | } else if(siteId == 1064) { |
| | | map.put("desc", siteId + "(二号灌装线)"); |
| | | } else if(siteId == 1078) { |
| | | map.put("desc", siteId + "(三号灌装线)"); |
| | | } |
| | | result.add(map); |
| | | } |
| | | List<Integer> pickOutSite = basDevpService.getAvailableOutSite(103); |
| | |
| | | private Double weight; |
| | | |
| | | @ApiModelProperty(value= "长度") |
| | | private Double man_length; |
| | | private Double manLength; |
| | | |
| | | @ApiModelProperty(value= "体积") |
| | | private Double volume; |
| | |
| | | */ |
| | | List<WrkMast> selectLastInEmptyLoc(); |
| | | |
| | | /** |
| | | * 查询入灌装线站点在途任务数(未进罐装线里面) |
| | | * @param site 入罐装线站点 |
| | | */ |
| | | int selectInGzxCount(@Param("site") int site); |
| | | } |
| | |
| | | // 完成空桶库入出库任务另一个任务 |
| | | int workNoOther = 0; |
| | | // 入库 + 库位转移 |
| | | if ((wrkMast.getWrkSts() < 4 && wrkMast.getIoType() != 101 && wrkMast.getIoType() != 110) || (wrkMast.getWrkSts() > 10 && wrkMast.getIoType()==11)) { |
| | | if ((wrkMast.getWrkSts() < 4 && wrkMast.getIoType() != 101 && wrkMast.getIoType() != 110) || (wrkMast.getWrkSts() > 10 |
| | | && wrkMast.getIoType()==11) || wrkMast.getIoType() == 10) { |
| | | wrkMast.setWrkSts(4L); |
| | | workNoOther = wrkMast.getWorkNoOther(); |
| | | // 出库 |
New file |
| | |
| | | package com.zy.asrs.task; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author pang.jiabao |
| | | * @description 米多泉州专用定时任务 |
| | | * @createDate 2024/7/10 9:20 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class MdqzScheduler { |
| | | |
| | | @Resource |
| | | private ConfigService configService; |
| | | |
| | | @Resource |
| | | private WrkMastService wrkMastService; |
| | | |
| | | // 读补尾桶配置,给对应任务号补尾桶信号 |
| | | @Scheduled(cron = "0/5 * * * * ?") |
| | | private void tailFillingBuckets() { |
| | | Config config = configService.selectConfigByCode("tailFillingBuckets"); |
| | | if (config != null && config.getStatus() == 1 && !Cools.isEmpty(config.getValue())) { |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", config.getValue())); |
| | | if (wrkMast != null && wrkMast.getCtnType() == 0) { |
| | | wrkMast.setCtnType(1); |
| | | wrkMastService.updateById(wrkMast); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | | import com.zy.asrs.entity.result.FindLocNoAttributeVo; |
| | | import com.zy.asrs.mapper.LocMastMapper; |
| | | import com.zy.asrs.mapper.WrkMastMapper; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.model.LocTypeDto; |
| | | import com.zy.common.model.StartupDto; |
| | |
| | | @Resource |
| | | private ConfigService configService; |
| | | |
| | | @Resource |
| | | private WrkMastMapper wrkMastMapper; |
| | | |
| | | @PostMapping("/pakin/loc/v1") |
| | | @ResponseBody |
| | | @Transactional |
| | |
| | | |
| | | StartupDto dto = null; |
| | | |
| | | // 入库有异常出到出库口1024 |
| | | if(!Cools.isEmpty(param.getErrMsg())){ |
| | | return exceptionIsOutOfTheWarehouse(param,sourceStaNo,waitPakin); |
| | | } |
| | | |
| | | if(param.getIoType() == 1) { |
| | | List<SearchLocParam.WantBucket> wantBucketFlag = param.getWantBucketFlag(); |
| | | for(SearchLocParam.WantBucket wantBucket: wantBucketFlag) { |
| | |
| | | if(waitPakin == null) { |
| | | return R.error("入库通知档为空"); |
| | | } else { |
| | | int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("wrk_sts", 2).eq("sta_no", wantBucket.getSite())); |
| | | if(wantBucket.getSite() == 1071 && count < 12 || wantBucket.getSite() == 1064 && count < 10 || wantBucket.getSite() == 1078 && count < 12) { |
| | | // <4 < 2 < 4 |
| | | int count = wrkMastMapper.selectInGzxCount(wantBucket.getSite()); |
| | | // int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("sta_no", wantBucket.getSite())); |
| | | if(wantBucket.getSite() == 1071 && count < 4 || wantBucket.getSite() == 1064 && count < 2 || wantBucket.getSite() == 1078 && count < 4) { |
| | | dto = startupFullPutStore(param,waitPakin,wantBucket); // 直供罐装线任务 |
| | | if (dto != null) { |
| | | log.info("WCS入库直供罐装线接口返参:{},托盘码:{}", dto, param.getBarcode()); |
| | |
| | | return R.ok().add(dto); |
| | | } |
| | | |
| | | /** |
| | | * 入库异常出到出库口1024 |
| | | */ |
| | | @Transactional(propagation = Propagation.REQUIRED) |
| | | public R exceptionIsOutOfTheWarehouse(SearchLocParam param, BasDevp sourceStaNo,WaitPakin waitPakin) { |
| | | |
| | | StartupDto dto = commonService.getLocNo(param,1024); |
| | | int workNo = dto.getWorkNo(); |
| | | Date now = new Date(); |
| | | // 生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(workNo); |
| | | wrkMast.setIoTime(now); |
| | | wrkMast.setWrkSts(2L); |
| | | wrkMast.setIoType(3); // 入出库状态:3.站到站 |
| | | wrkMast.setIoPri(13D); // 优先级 |
| | | wrkMast.setSourceStaNo(dto.getSourceStaNo()); |
| | | wrkMast.setStaNo(dto.getStaNo()); |
| | | wrkMast.setBarcode(param.getBarcode()); // 托盘码 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk("N"); // 空板 |
| | | wrkMast.setLinkMis("Y"); |
| | | wrkMast.setCtnType(0); // 尾托标识 |
| | | wrkMast.setPdcType(waitPakin != null ? waitPakin.getMaktx() : ""); // 空桶类型 |
| | | // 操作人员数据 |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiTime(now); |
| | | wrkMast.setLocNo(param.getErrMsg()); // 异常描述体现在目标库位上 |
| | | boolean res = wrkMastService.insert(wrkMast); |
| | | if (!res) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | // 生成工作档明细 |
| | | if(waitPakin != null) { |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.sync(waitPakin); |
| | | wrkDetl.setWrkNo(wrkMast.getWrkNo()); |
| | | wrkDetl.setIoTime(wrkMast.getIoTime()); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setModiTime(now); |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("保存工作明细失败"); |
| | | } |
| | | // 更新入库通知档 ioStatus ===>> Y |
| | | Wrapper<WaitPakin> wrapper = new EntityWrapper<WaitPakin>() |
| | | .eq("zpallet", param.getBarcode()); |
| | | WaitPakin setParam = new WaitPakin(); |
| | | setParam.setLocNo(dto.getLocNo()); |
| | | setParam.setIoStatus("Y"); |
| | | setParam.setModiTime(now); |
| | | if (!waitPakinService.update(setParam, wrapper)) { |
| | | throw new CoolException("更新通知档失败"); |
| | | } |
| | | } |
| | | |
| | | // 更新源站点信息 |
| | | sourceStaNo.setWrkNo(workNo); |
| | | sourceStaNo.setModiTime(now); |
| | | if (!basDevpService.updateById(sourceStaNo)){ |
| | | throw new CoolException("更新源站失败"); |
| | | } |
| | | |
| | | return R.ok(dto); |
| | | } |
| | | |
| | | // 罐装完成入库 |
| | | @PostMapping("/pakin/CanningLine/loc/v1") |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | // 获取系统配置,看成品罐装完成是否直接出到发货口 |
| | | Config config = configService.selectConfigByCode("gzwcfh"); |
| | | Config config = configService.selectConfigByCode("gzxfh" + param.getSourceStaNo()); |
| | | boolean fhFlag = false; |
| | | int fhk = 0; // 发货口 |
| | | if (config != null && config.getStatus() == 1 && !Cools.isEmpty(config.getValue())) { |
| | | String[] split = config.getValue().split("="); |
| | | for(String item : split) { |
| | | if(param.getMatnr().equals(item)) { |
| | | fhFlag = true; |
| | | break; |
| | | } |
| | | } |
| | | fhk = Integer.parseInt(config.getValue()); |
| | | } |
| | | |
| | | Date now = new Date(); |
| | | StartupDto dto; |
| | | |
| | | // 判断贴标异常,复检重量异常的,不分配库位,去往异常口1090 |
| | | // if ( !param.isTbFlag() || param.getGrossWeight() < param.getWeight()) { |
| | | // if ( !param.isTbFlag() || !param.isReinspection()) { |
| | | // |
| | | // // 生成工作档 ------------------------------------------------------ |
| | | // WrkMast wrkMast = new WrkMast(); |
| | |
| | | // wrkDetl.setManuDate(param.getManuDate()); |
| | | // wrkDetl.setWeight(param.getWeight()); |
| | | // wrkDetl.setManLength(param.getGrossWeight()); |
| | | // wrkDetl.setInspect(1); // 贴标成功 |
| | | // wrkDetl.setInspect(param.isTbFlag()?1:0); // 贴标成功 |
| | | // wrkDetl.setIoTime(now); |
| | | // wrkDetl.setAppeTime(now); |
| | | // wrkDetl.setModel(wrkDetl1.getMaktx()); // 保存空桶名称 |
| | | // wrkDetlService.insert(wrkDetl); |
| | | // |
| | | // dto = new StartupDto(); |
| | |
| | | wrkMast.setIoPri(13D); // 优先级 |
| | | // wrkMast.setCrnNo(dto.getCrnNo()); |
| | | wrkMast.setSourceStaNo(param.getSourceStaNo()); |
| | | wrkMast.setStaNo(1016); |
| | | wrkMast.setStaNo(fhk); |
| | | // wrkMast.setLocNo(dto.getLocNo()); |
| | | wrkMast.setBarcode(wrkMast1.getBarcode()); // 托盘码 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | |
| | | wrkDetl.setInspect(1); |
| | | wrkDetl.setIoTime(now); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setModel(wrkDetl1.getMaktx()); // 保存空桶名称 |
| | | wrkDetlService.insert(wrkDetl); |
| | | |
| | | dto = new StartupDto(); |
| | |
| | | wrkDetl.setInspect(1); // 贴标成功 |
| | | wrkDetl.setIoTime(now); |
| | | wrkDetl.setAppeTime(now); |
| | | log.warn("成品罐装完成,桶类型保存,新任务号:{},旧任务号:{},旧任务桶型:{}",workNo,wrkMast1.getWrkNo(),wrkDetl1.getMaktx()); |
| | | wrkDetl.setModel(wrkDetl1.getMaktx()); // 保存空桶名称 |
| | | wrkDetlService.insert(wrkDetl); |
| | | |
| | | // 更新目标库位状态 |
| | |
| | | |
| | | if(!param.isTbFlag()) { //下线出库 |
| | | wrkMast.setSourceStaNo(1090); |
| | | wrkMast.setStaNo(1016); // 异常下线默认入库站点为1016 |
| | | wrkMast.setStaNo(1024); // 异常下线默认入库站点为1016 |
| | | wrkMastService.updateById(wrkMast); |
| | | return R.ok(); |
| | | } |
| | |
| | | // 复检重量 |
| | | private double grossWeight; |
| | | |
| | | // 复检合格否 |
| | | private boolean reinspection; |
| | | |
| | | // 源站点 |
| | | private Integer sourceStaNo; |
| | | |
| | |
| | | // 罐装线要桶 罐装线号-桶类型 |
| | | private List<WantBucket> wantBucketFlag; |
| | | |
| | | // 外形检测/称重报错,出到出库口1024 |
| | | private String errMsg; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | public static class WantBucket{ |
| | |
| | | |
| | | <select id="selectToBeHistoryData" resultMap="BaseResultMap"> |
| | | select * from asr_wrk_mast |
| | | where wrk_sts=5 |
| | | where wrk_sts=5 and dateadd(mi,1,modi_time) <= getdate() and wrk_no not in (select wrk_no from asr_bas_devp) |
| | | or (wrk_sts=15 and ove_mk='Y' and wrk_no not in (select wrk_no from asr_bas_devp)) |
| | | or (wrk_sts=15 and dateadd(mi,2,crn_end_time) <= getdate() and wrk_no not in (select wrk_no from asr_bas_devp)) |
| | | or (wrk_sts=15 and dateadd(mi,1,modi_time) <= 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 |
| | | </select> |
| | |
| | | <select id="selectLastInEmptyLoc" resultType="com.zy.asrs.entity.WrkMast"> |
| | | select wrk_no wrkNo,ctn_type ctnType,Pdc_type pdcType,loc_no locNo from asr_wrk_mast where sta_no = 1050 and wrk_sts in(2,9,10) order by io_time desc |
| | | </select> |
| | | <select id="selectInGzxCount" resultType="java.lang.Integer"> |
| | | SELECT |
| | | count(m.wrk_no) |
| | | FROM |
| | | asr_wrk_mast m |
| | | LEFT JOIN asr_bas_devp d ON |
| | | m.wrk_no = d.wrk_no |
| | | WHERE |
| | | (m.wrk_sts IN (2, 9) |
| | | AND m.sta_no = #{site} |
| | | AND d.wrk_no IS NOT NULL) |
| | | OR (m.wrk_sts = 10 |
| | | AND m.sta_no = #{site} |
| | | AND d.wrk_no IS NULL) |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | ,{field: 'manuDate', align: 'center',title: '生产日期', hide: true} |
| | | ,{field: 'itemNum', align: 'center',title: '品项数', hide: true} |
| | | ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '单箱净重', hide: true} |
| | | ,{field: 'length', align: 'center',title: '单箱毛重', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '净重', hide: true} |
| | | ,{field: 'manLength', align: 'center',title: '毛重', hide: true} |
| | | ,{field: 'volume', align: 'center',title: '单箱体积', hide: true} |
| | | ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true} |
| | | ,{field: 'supp', align: 'center',title: '供应商', hide: true} |
| | |
| | | function getCol() { |
| | | var cols = [ |
| | | {type: 'checkbox'}, |
| | | {field: 'locNo$', align: 'center',title: '库位号'} |
| | | ,{field: 'storeDate', align: 'center',title: '库龄(天)', sort:true} |
| | | ,{field: 'matnr', align: 'center',title: '商品编号', sort:true} |
| | | {field: 'locNo$', align: 'center',title: '库位号', width: 100} |
| | | ,{field: 'storeDate', align: 'center',title: '库龄(天)', width: 100, sort:true} |
| | | ,{field: 'matnr', align: 'center',title: '商品编号',width: 110, sort:true} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', sort:true} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'batch', align: 'center',title: '批号', width: 300, sort:true} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码'} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'model', align: 'center',title: '代码', hide: true} |
| | | ,{field: 'batch', align: 'center',title: '批号', sort:true} |
| | | ,{field: 'anfme', align: 'center',title: '数量', width: 60} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码', width: 100} |
| | | ,{field: 'specs', align: 'center',title: '规格', hide: true} |
| | | ,{field: 'model', align: 'center',title: '桶类型'} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | |
| | | ,{field: 'manuDate', align: 'center',title: '生产日期', hide: true} |
| | | ,{field: 'itemNum', align: 'center',title: '品项数', hide: true} |
| | | ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '单箱净重', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '净重'} |
| | | ,{field: 'man_length', align: 'center',title: '毛重'} |
| | | ,{field: 'length', align: 'center',title: '单箱毛重', hide: true} |
| | | ,{field: 'volume', align: 'center',title: '单箱体积', hide: true} |
| | | ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true} |
| | |
| | | ,{field: 'source$', align: 'center',title: '制购', hide: true} |
| | | ,{field: 'check$', align: 'center',title: '要求检验', hide: true} |
| | | ,{field: 'danger$', align: 'center',title: '危险品', hide: true} |
| | | ,{field: 'frozen$', align: 'center',title: '冻结否', |
| | | ,{field: 'appeTime$', align: 'center',title: '创建时间'} |
| | | ,{field: 'frozen$', align: 'center',title: '冻结否',hide: true, |
| | | templet: function(d) { |
| | | // 根据条件判断字体颜色 |
| | | if (d.frozen$ === '已冻结') { |
| | |
| | | |
| | | // cols.push.apply(cols, detlCols); |
| | | cols.push({field: 'modiUser$', align: 'center',title: '修改人员',hide: true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间',hide: true} |
| | | ) |
| | | return cols; |
| | | } |
| | |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="matnr" placeholder="商品编号" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="maktx" placeholder="商品名称" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="specs" placeholder="规格" autocomplete="off"> |
| | | <input class="layui-input" type="text" name="batch" placeholder="批号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="orderNo" placeholder="订单号" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" type="text" name="model" placeholder="桶型" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |