| | |
| | | import com.core.common.*; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | | import com.zy.asrs.entity.result.KeyValueVo; |
| | | import com.zy.asrs.service.InOutService; |
| | | import com.zy.asrs.service.MatBarcodeService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.utils.MatExcelListener; |
| | | import com.zy.common.CodeRes; |
| | |
| | | private MatService matService; |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | @Autowired |
| | | private MatBarcodeService matBarcodeService; |
| | | |
| | | |
| | | @RequestMapping(value = "/mat/auto/matnr/auth") |
| | | public R autoMatnr(){ |
| | |
| | | return R.error("编号已存在"); |
| | | } |
| | | Date now = new Date(); |
| | | InOut inOut=new InOut(); |
| | | mat.setCreateBy(getUserId()); |
| | | mat.setCreateTime(now); |
| | | mat.setUpdateBy(getUserId()); |
| | | mat.setUpdateTime(now); |
| | | mat.setStatus(1); |
| | | inOut.setMatnr(mat.getMatnr()); |
| | | inOut.setMaktx(mat.getMaktx()); |
| | | inOut.setColor(mat.getColor()); |
| | | inOut.setSpecs(mat.getSpecs()); |
| | | inOut.setTemp1(""); |
| | | if (!matService.insert(mat)) { |
| | | throw new CoolException("商品档案添加失败,请联系管理员"); |
| | | } |
| | |
| | | mat.setUpdateBy(getUserId()); |
| | | mat.setUpdateTime(new Date()); |
| | | matService.updateById(mat); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /*物料托盘绑定*/ |
| | | @RequestMapping(value = "/mat/barcode/auth") |
| | | @ManagerAuth |
| | | public R addBarcodeMatnr(Mat mat) { |
| | | if (Cools.isEmpty(mat.getUnit())){ |
| | | return R.error(BaseRes.PARAM); |
| | | } |
| | | matBarcodeService.addBarcodeMatnrTwo(mat); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @Autowired |
| | | private MatService matService; |
| | | @Autowired |
| | | private MatBarcodeService matBarcodeService; |
| | | @Autowired |
| | | private CommonService commonService; |
| | | @Autowired |
| | | private WorkService workService; |
| | |
| | | } |
| | | } |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @RequestMapping("/callBarcode") |
| | | @ManagerAuth(memo = "PDA呼叫托盘出库") |
| | | public R callBarcode(@RequestBody CombParam combParam) { |
| | | logger.info("PDA呼叫托盘出库"); |
| | | if (combParam == null) { |
| | | return R.parse(BaseRes.PARAM); |
| | | } |
| | | combParam.getCombMats().forEach(combMat -> { |
| | | Mat mat = matService.selectByMatnr(combMat.getMatnr()); |
| | | if (mat == null) { |
| | | throw new CoolException("商品档案不存在"); |
| | | } |
| | | MatBarcode matBarcode = matBarcodeService.selectbyMatnr(combMat.getMatnr()); |
| | | if (matBarcode == null) { |
| | | throw new CoolException("该物料未与托盘绑定"); |
| | | } |
| | | LocMast locMast = locMastService.selectByBarcode(matBarcode.getZpallet()); |
| | | if (locMast == null) { |
| | | throw new CoolException("未找到与该物料绑定的托盘"); |
| | | } |
| | | int wrkNo = commonService.getWorkNo(0); |
| | | Date now = new Date(); |
| | | //生成工作档 |
| | | WrkMast wrkMast = new WrkMast(); |
| | | wrkMast.setWrkNo(wrkNo); |
| | | wrkMast.setIoTime(new Date()); |
| | | wrkMast.setWrkSts(11L);//工作状态:生成出库ID |
| | | wrkMast.setIoType(101);//入出库状态:并板出库 |
| | | wrkMast.setIoPri(13D);//优先级 |
| | | wrkMast.setCrnNo(locMast.getCrnNo()); |
| | | // wrkMast.setSourceStaNo(dto.getSourceStaNo());//源站 |
| | | wrkMast.setStaNo(101);// 目标站 |
| | | wrkMast.setSourceLocNo(locMast.getLocNo());// 源库位 |
| | | wrkMast.setBarcode(matBarcode.getZpallet()); // 托盘码 |
| | | wrkMast.setFullPlt("Y"); // 满板:Y |
| | | wrkMast.setPicking("N"); // 拣料 |
| | | wrkMast.setExitMk("N"); // 退出 |
| | | wrkMast.setEmptyMk("N"); // 空板 |
| | | wrkMast.setLinkMis("Y"); |
| | | // wrkMast.setScWeight(weight); |
| | | wrkMast.setCtnType(0); // 容器类型 |
| | | // 操作人员数据 |
| | | wrkMast.setAppeTime(now); |
| | | wrkMast.setModiTime(now); |
| | | boolean res = wrkMastService.insert(wrkMast); |
| | | if (!res) { |
| | | throw new CoolException("保存工作档失败"); |
| | | } |
| | | if (locMast.getLocSts().equals("F")) { |
| | | locMast.setLocSts("R"); // R.出库预约 |
| | | locMast.setModiTime(now); |
| | | if (!locMastService.updateById(locMast)) { |
| | | throw new CoolException("改变库位状态失败"); |
| | | } |
| | | } else { |
| | | throw new CoolException(locMast.getLocNo() + "目标库位状态不为F"); |
| | | } |
| | | }); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.zy.asrs.entity.MatBarcode; |
| | | import com.zy.asrs.entity.WaitPakin; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface WaitPakinService extends IService<WaitPakin> { |
| | | |
| | | void comb(List<MatBarcode> list); |
| | | } |
| | |
| | | @Autowired |
| | | private ManLocDetlMapper manLocDetlMapper; |
| | | @Autowired |
| | | private MatBarcodeService matBarcodeService; |
| | | @Autowired |
| | | private AdjDetlService adjDetlService; |
| | | |
| | | |
| | |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(detlDto.getMatnr() + "商品档案不存在"); |
| | | } |
| | | //校验当前物料与托盘绑定信息是否正确 |
| | | MatBarcode matBarcode = new MatBarcode(); |
| | | MatBarcode mb = matBarcodeService.selectbyMatnr(detlDto.getMatnr()); |
| | | if (mb != null){ |
| | | if (!mb.getZpallet().equals(param.getBarcode())){ |
| | | throw new CoolException(detlDto.getMatnr() + "该物料与其他托盘绑定,请先解绑"); |
| | | } |
| | | }else { |
| | | matBarcode.setZpallet(param.getBarcode());//托盘码 |
| | | matBarcode.setMatnr(mat.getMatnr());//物料号 |
| | | matBarcode.setMaktx(mat.getMaktx());//物料名称 |
| | | matBarcode.setSpecs(mat.getSpecs());//规格 |
| | | matBarcode.setModel(mat.getModel());//型号 |
| | | if (!matBarcodeService.insert(matBarcode)) { |
| | | throw new CoolException("物料与托盘绑定失败"); |
| | | } |
| | | } |
| | | WaitPakin waitPakin = new WaitPakin(); |
| | | waitPakin.sync(mat); |
| | | waitPakin.setProType(detlDto.getProType()); |
| | |
| | | Mat mat = matService.selectByMatnr(orderDetl.getMatnr()); |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(orderDetl.getMatnr() + "商品档案不存在"); |
| | | } |
| | | //校验当前物料与托盘绑定信息是否正确 |
| | | MatBarcode matBarcode = new MatBarcode(); |
| | | MatBarcode mb = matBarcodeService.selectbyMatnr(orderDetl.getMatnr()); |
| | | if (mb != null){ |
| | | if (!mb.getZpallet().equals(param.getBarcode())){ |
| | | throw new CoolException(orderDetl.getMatnr() + "该物料与其他托盘绑定,请先解绑"); |
| | | } |
| | | }else { |
| | | matBarcode.setZpallet(param.getBarcode());//托盘码 |
| | | matBarcode.setMatnr(mat.getMatnr());//物料号 |
| | | matBarcode.setMaktx(mat.getMaktx());//物料名称 |
| | | matBarcode.setSpecs(mat.getSpecs());//规格 |
| | | matBarcode.setModel(mat.getModel());//型号 |
| | | if (!matBarcodeService.insert(matBarcode)) { |
| | | throw new CoolException("物料与托盘绑定失败"); |
| | | } |
| | | } |
| | | WaitPakin waitPakin = new WaitPakin(); |
| | | waitPakin.sync(mat); |
| | |
| | | private MatService matService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | |
| | | @Override |
| | | public void comb(List<MatBarcode> list) { |
| | | String zpallet = list.get(0).getZpallet(); |
| | | if (zpallet.length() != 8) { |
| | | throw new CoolException("条码长度不是8位===>>" + zpallet); |
| | | } |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", zpallet)); |
| | | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", zpallet)); |
| | | WrkMast wrkMast = wrkMastService.selectByBarcode(zpallet); |
| | | if (countLoc > 0 || (countWrk > 0 && wrkMast.getWrkSts() != 15)) { |
| | | throw new CoolException("组托档/工作档/库存条码数据已存在===>>" + zpallet); |
| | | } |
| | | Date now = new Date(); |
| | | for (MatBarcode matBarcode : list) { |
| | | Mat mat = matService.selectByMatnr(matBarcode.getMatnr()); |
| | | if (Cools.isEmpty(mat)) { |
| | | throw new CoolException(matBarcode.getMatnr() + "商品档案不存在"); |
| | | } |
| | | WaitPakin waitPakin1 = new WaitPakin(); |
| | | waitPakin1.sync(mat); |
| | | ///waitPakin1.setProType(dto.getProType()); |
| | | //waitPakin1.setTemp2(dto.getTemp2()); |
| | | //waitPakin1.setOutOrderNo(dto.getOutOrderNo()); |
| | | //waitPakin1.setBatch(dto.getBatch()); |
| | | waitPakin1.setZpallet(matBarcode.getZpallet()); // 托盘码 |
| | | waitPakin1.setIoStatus("N"); // 入出状态 |
| | | waitPakin1.setAnfme(1.0); // 数量 |
| | | waitPakin1.setStatus("Y"); // 状态 |
| | | waitPakin1.setModel(mat.getName()); |
| | | //waitPakin1.setAppeUser(waitPakin.getAppeUser()); |
| | | waitPakin1.setAppeTime(now); |
| | | //waitPakin1.setModiUser(waitPakin.getAppeUser()); |
| | | waitPakin1.setModiTime(now); |
| | | //waitPakin1.setMemo(detlDto.getMemo()); |
| | | if (!waitPakinService.insert(waitPakin1)) { |
| | | throw new CoolException("保存入库通知档失败"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.InOut; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.Tag; |
| | | import com.zy.asrs.mapper.TagMapper; |
| | | import com.zy.asrs.service.InOutService; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.service.TagService; |
| | | import com.zy.common.entity.MatExcel; |
| | |
| | | TagService tagService = SpringUtils.getBean(TagService.class); |
| | | TagMapper tagMapper = SpringUtils.getBean(TagMapper.class); |
| | | MatService matService = SpringUtils.getBean(MatService.class); |
| | | InOutService inOutService = SpringUtils.getBean(InOutService.class); |
| | | Date now = new Date(); |
| | | Long tagId; |
| | | // 分类 |
| | |
| | | limit: 500, |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {fixed: 'left', align: 'center', field: 'count', title: '数量', style:'color: blue', width:50}, |
| | | {fixed: 'left', align: 'center', field: 'anfme', title: '数量', style:'color: blue', width:50}, |
| | | {field: 'matnr', align: 'center', title: '商品编号'}, |
| | | {field: 'maktx', align: 'center', title: '商品名称'}, |
| | | {field: 'model', align: 'center',title: '产品代码'} |
| | | {field: 'maktx', align: 'center', title: '商品名称'} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | done: function (res, curr, anfme) { |
| | | } |
| | | }); |
| | | |
| | |
| | | let toPush = true; |
| | | for (var j=0;j<matData.length;j++){ |
| | | if (data.matnr === matData[j].matnr) { |
| | | matData[j].count = Number(matData[j].count) + Number(data.count); |
| | | matData[j].anfme = Number(matData[j].anfme) + Number(data.anfme); |
| | | toPush = false; |
| | | } |
| | | } |
| | |
| | | <!-- 导航栏 --> |
| | | <ul class="nav"> |
| | | <li><a id="comb" onclick="nav(this.id)" class="nav-select" href="#">组托</a></li> |
| | | <li><a id="stockIn" onclick="nav(this.id)" class="nav-unselect" href="#">入库</a></li> |
| | | <li><a id="stockOut" onclick="nav(this.id)" class="nav-unselect" href="#">出库</a></li> |
| | | <!-- <li><a id="stockIn" onclick="nav(this.id)" class="nav-unselect" href="#">入库</a></li>--> |
| | | <!-- <li><a id="stockOut" onclick="nav(this.id)" class="nav-unselect" href="#">出库</a></li>--> |
| | | </ul> |
| | | |
| | | <!-- 主体内容 --> |
| | |
| | | <input id="maktx" type="text" disabled="disabled"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>规格</span> |
| | | <input id="specs" type="text" disabled="disabled"> |
| | | <span>图号</span> |
| | | <input id="model" type="text" disabled="disabled"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>单位</span> |
| | | <input id="unit" type="text" disabled="disabled"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span>批次号</span> |
| | | <input id="barcode" type="text" disabled="disabled"> |
| | | </div> |
| | | <div class="form-item"> |
| | | <span style="vertical-align: middle">数量</span> |
| | |
| | | if (res.code === 200) { |
| | | if (res.data != null) { |
| | | $('#maktx').val(res.data.maktx); |
| | | $('#specs').val(res.data.specs); |
| | | $('#model').val(res.data.model); |
| | | $('#unit').val(res.data.unit); |
| | | $('#barcode').val(res.data.barcode); |
| | | countDom.val(initMatCount); |
| | | $('#count').focus().select(); |
| | | } |
| | |
| | | */ |
| | | function confirm(){ |
| | | var data = { |
| | | matNo: $('#matnr').val(), |
| | | matName: $('#maktx').val(), |
| | | count: countDom.val() |
| | | matnr: $('#matnr').val(), |
| | | maktx: $('#maktx').val(), |
| | | anfme: countDom.val() |
| | | }; |
| | | parent.addTableData(data); |
| | | parent.layer.close(parent.matCodeLayerIdx); |
| | |
| | | cols: [[ |
| | | {fixed: 'left', align: 'center', field: 'count', title: '数量', style:'color: blue', width:50}, |
| | | {field: 'matnr', align: 'center', title: '商品编号'}, |
| | | {field: 'maktx', align: 'center', title: '商品名称'}, |
| | | {field: 'model', align: 'center',title: '产品代码'} |
| | | {field: 'maktx', align: 'center', title: '商品名称'} |
| | | ]], |
| | | done: function (res, curr, count) { |
| | | |
| | |
| | | {field: 'count', align: 'center', title: '数量', event: 'detail', style:'color: blue', width:50}, |
| | | {field: 'matnr', align: 'center', title: '编码', event: 'detail'}, |
| | | {field: 'maktx', align: 'center', title: '名称', event: 'detail'}, |
| | | {field: 'model', align: 'center',title: '产品代码', event: 'detail'}, |
| | | {field: 'locNo', align: 'center', title: '库位', event: 'detail'} |
| | | ]], |
| | | done: function (res, curr, count) { |