| | |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.*; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.InOut; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.MatPrint; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | 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 SnowflakeIdWorker snowflakeIdWorker; |
| | | @Autowired |
| | | private InOutService inOutService; |
| | | @Autowired |
| | | private MatBarcodeService matBarcodeService; |
| | | |
| | | @RequestMapping(value = "/mat/auto/matnr/auth") |
| | | public R autoMatnr(){ |
| | |
| | | if (Cools.isEmpty(mat) || null==mat.getId()){ |
| | | return R.error(); |
| | | } |
| | | if (mat.getColor().equals("正常")){ |
| | | mat.setColor("报废"); |
| | | }else if (mat.getColor().equals("报废")){ |
| | | mat.setColor("正常"); |
| | | } |
| | | InOut inOut = inOutService.selectByMatnr(mat.getMatnr()); |
| | | inOut.setMatnr(mat.getMatnr()); |
| | | inOut.setMaktx(mat.getMaktx()); |
| | | inOut.setColor(mat.getColor()); |
| | | inOut.setSpecs(mat.getSpecs()); |
| | | mat.setUpdateBy(getUserId()); |
| | | mat.setUpdateTime(new Date()); |
| | | matService.updateById(mat); |
| | | inOutService.updateById(inOut); |
| | | 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(); |
| | | // } |
| | | |
| | | @RequestMapping(value = "/mat/delete/auth") |
| | | @ManagerAuth |
| | | public R delete(@RequestParam String param){ |
| | |
| | | package com.zy.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.MatBarcode; |
| | | import com.zy.asrs.entity.WaitPakin; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | void deleteMatBarcode(List<MatBarcode> list); |
| | | |
| | | void addBarcodeMatnr(WaitPakin waitPakin); |
| | | |
| | | void addBarcodeMatnrTwo(Mat mat); |
| | | } |
| | |
| | | throw new CoolException("物料托盘绑定失败"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void addBarcodeMatnrTwo(Mat mat) { |
| | | Mat m = matService.selectById(mat); |
| | | if (m == null){ |
| | | throw new CoolException("物料不存在,请先添加物料数据"); |
| | | } |
| | | MatBarcode matBarcode = matBarcodeMapper.selectByMatnr(mat.getMatnr()); |
| | | if (matBarcode != null){ |
| | | throw new CoolException("该物料已经绑定托盘,请勿重复绑定"); |
| | | } |
| | | if (mat.getColor().equals("报废")){ |
| | | throw new CoolException("该物料已报废,请勿绑定"); |
| | | } |
| | | MatBarcode mb=new MatBarcode(); |
| | | mb.setZpallet(mat.getUnit()); |
| | | mb.setMatnr(mat.getMatnr()); |
| | | mb.setMaktx(mat.getMaktx()); |
| | | mb.setSpecs(mat.getSpecs()); |
| | | mb.setModel(mat.getModel()); |
| | | if (!matBarcodeService.insert(mb)){ |
| | | throw new CoolException("物料托盘绑定失败"); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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()); |
| | |
| | | if (Cools.isEmpty(wrkMast)) { |
| | | throw new CoolException(workNo + "工作档不存在"); |
| | | } |
| | | if (wrkMast.getWrkSts() == 4 || wrkMast.getWrkSts() >= 14) { |
| | | if (wrkMast.getWrkSts() == 4 || (wrkMast.getWrkSts() >= 14 && wrkMast.getWrkSts() <= 15)) { |
| | | throw new CoolException("当前工作档已完成"); |
| | | } |
| | | // 入库 + 库位转移 |
| | | if (wrkMast.getWrkSts() < 4 || (wrkMast.getWrkSts() > 10 && wrkMast.getIoType() == 11)) { |
| | | wrkMast.setWrkSts(4L); |
| | | // 出库 |
| | | } else if (wrkMast.getWrkSts() > 10) { |
| | | } else if (wrkMast.getWrkSts() > 10 && wrkMast.getWrkSts() < 15) { |
| | | wrkMast.setWrkSts(14L); |
| | | }else if(wrkMast.getWrkSts() >= 103 && wrkMast.getWrkSts() <= 105){ |
| | | wrkMast.setWrkSts(4L); |
| | | }else if (wrkMast.getWrkSts() >= 106 && wrkMast.getWrkSts() <=108){ |
| | | wrkMast.setWrkSts(14L); |
| | | } |
| | | Date now = new Date(); |
| | |
| | | locDetl.setZpallet(wrkDetl.getZpallet()); // 托盘条码 |
| | | locDetl.setModiTime(now); |
| | | locDetl.setAppeTime(now); |
| | | locDetl.setModel(wrkDetl.getModel()); |
| | | |
| | | InOut inOut=inOutService.selectByMatnr(wrkDetl.getMatnr()); |
| | | if (inOut != null){ |
| | | inOut.setTemp1("在库"); |
| | | inOut.setModiTime(now.toString()); |
| | | // inOut.setModiTime(now.toString()); |
| | | } |
| | | if (inOutService.updateById(inOut)){ |
| | | if (!inOutService.updateById(inOut)){ |
| | | return FAIL.setMsg("更新模具属性失败"); |
| | | } |
| | | |
| | |
| | | inOut.setTemp1("不在库"); |
| | | // inOut.setModiTime(now.toString()); |
| | | } |
| | | if (inOutService.updateById(inOut)){ |
| | | if (!inOutService.updateById(inOut)){ |
| | | return FAIL.setMsg("更新模具属性失败"); |
| | | } |
| | | |
| | |
| | | inOut.setTemp1("在库"); |
| | | // inOut.setModiTime(now.toString()); |
| | | } |
| | | if (inOutService.updateById(inOut)){ |
| | | if (!inOutService.updateById(inOut)){ |
| | | return FAIL.setMsg("更新模具属性失败"); |
| | | } |
| | | |
| | |
| | | inOut.setTemp1("不在库"); |
| | | // inOut.setModiTime(now.toString()); |
| | | } |
| | | if (inOutService.updateById(inOut)){ |
| | | if (!inOutService.updateById(inOut)){ |
| | | return FAIL.setMsg("更新模具属性失败"); |
| | | } |
| | | } |
| | |
| | | wrkDetl.setIoTime(wrkMast.getIoTime()); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setModiTime(now); |
| | | wrkDetl.setModel(waitPakin.getModel()); |
| | | if (!Cools.isEmpty(waitPakin.getOrderNo())) { |
| | | Order order = orderService.selectByNo(waitPakin.getOrderNo()); |
| | | if (order != null) { |
| | |
| | | ,{field: 'name', align: 'center',title: '套号'} |
| | | ,{field: 'color', align: 'center',title: '状态', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | | ,{field: 'unit', align: 'center',title: '单位'} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | | ,{field: 'price', align: 'center',title: '单价', hide: true} |
| | | ,{field: 'sku', align: 'center',title: '材质'} |
| | | ,{field: 'sku', align: 'center',title: '材质', hide: true} |
| | | ,{field: 'units', align: 'center',title: '单位量', hide: true} |
| | | ,{field: 'barcode', align: 'center',title: '条码', hide: true} |
| | | ,{field: 'origin', 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: false} |
| | | ,{field: 'length', 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} |
| | |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间', hide: true} |
| | | ,{field: 'memo', align: 'center',title: '备注', hide: true} |
| | | ,{field: 'proType', align: 'center',title: '属性', hide: false} |
| | | ,{field: 'temp1', align: 'center',title: '名称总称', hide: false} |
| | | ,{field: 'temp1', align: 'center',title: '名称总称', hide: true} |
| | | ,{field: 'outOrderNo', align: 'center',title: '合同号', hide: true} |
| | | ,{field: 'temp2', align: 'center',title: '客户图号', hide: false} |
| | | ,{field: 'temp2', align: 'center',title: '客户图号', hide: true} |
| | | |
| | | |
| | | ] |
| | | |
| | | var detlCols = [ |
| | | {field: 'matnr', align: 'center',title: '商品编号(品号)', sort:true} |
| | | ,{field: 'model', align: 'center',title: '代码', hide: false} |
| | | ,{field: 'model', align: 'center',title: '套号', hide: false} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称(品名)', sort:true} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: true} |
| | | ,{field: 'spgNO', align: 'center',title: '派工单号', hide:true,sort:true} |
| | | ,{field: 'batch', align: 'center',title: '批次', hide:true,sort:true} |
| | | ,{field: 'outOrderNo', align: 'center',title: '合同号', sort:true} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: false} |
| | | ,{field: 'outOrderNo', align: 'center',title: '合同号', sort:true, hide: true} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | | ,{field: 'anfme', align: 'center',title: '数量', hide: false} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码', hide: false} |
| | | ,{field: 'specs', align: 'center',title: '规格', hide: false} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | | ,{field: 'price', align: 'center',title: '单价', hide: true} |
| | | ,{field: 'sku', align: 'center',title: '材质', hide: false} |
| | | ,{field: 'sku', align: 'center',title: '材质', hide: true} |
| | | ,{field: 'units', align: 'center',title: '单位量', hide: true} |
| | | ,{field: 'barcode', align: 'center',title: '条码', hide: true} |
| | | ,{field: 'origin', 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: false} |
| | | ,{field: 'length', align: 'center',title: '单箱毛重', hide: false} |
| | | ,{field: 'weight', align: 'center',title: '总重量', hide: true} |
| | | ,{field: 'length', 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:false } |
| | |
| | | ,{field: 'check$', align: 'center',title: '要求检验', hide: true} |
| | | ,{field: 'danger$', align: 'center',title: '危险品', hide: true} |
| | | ,{field: 'proType', align: 'center',title: '属性', hide: false} |
| | | ,{field: 'temp1', align: 'center',title: '名称总称', hide: false} |
| | | ,{field: 'temp2', align: 'center',title: '客户图号', hide: false} |
| | | ,{field: 'temp1', align: 'center',title: '名称总称', hide: true} |
| | | ,{field: 'temp2', align: 'center',title: '客户图号', hide: true} |
| | | |
| | | ] |
| | | |
| | |
| | | case 'edit': |
| | | showEditModel(data) |
| | | break; |
| | | case 'editBarcode': |
| | | showEditModelBarcode(data) |
| | | break; |
| | | } |
| | | }); |
| | | |
| | |
| | | }); |
| | | } |
| | | |
| | | // /* 显示表单弹窗 */ |
| | | // function showEditModelBarcode(mData) { |
| | | // admin.open({ |
| | | // type: 1, |
| | | // area: '600px', |
| | | // title: '绑定商品', |
| | | // content: $('#editDialogBarcode').html(), |
| | | // success: function (layero, dIndex) { |
| | | // // 回显表单数据 |
| | | // form.val('detail', mData); |
| | | // // 表单提交事件 |
| | | // form.on('submit(editSubmit)', function (data) { |
| | | // console.log(data) |
| | | // data.field.tagId = insXmSel.getValue('valueStr'); |
| | | // if (isEmpty(data.field.tagId)) { |
| | | // layer.msg('分类不能为空', {icon: 2}); |
| | | // return false; |
| | | // } |
| | | // var loadIndex = layer.load(2); |
| | | // $.ajax({ |
| | | // url: baseUrl+"/mat/barcode/auth", |
| | | // headers: {'token': localStorage.getItem('token')}, |
| | | // data: data.field, |
| | | // method: 'POST', |
| | | // success: function (res) { |
| | | // layer.close(loadIndex); |
| | | // if (res.code === 200){ |
| | | // layer.close(dIndex); |
| | | // layer.msg(res.msg, {icon: 1}); |
| | | // $(".layui-laypage-btn")[0].click(); |
| | | // } else if (res.code === 403){ |
| | | // top.location.href = baseUrl+"/"; |
| | | // }else { |
| | | // layer.msg(res.msg, {icon: 2}); |
| | | // } |
| | | // } |
| | | // }) |
| | | // return false; |
| | | // }); |
| | | // // 渲染下拉树 |
| | | // var insXmSel = xmSelect.render({ |
| | | // el: '#tagSelBarcode', |
| | | // height: '250px', |
| | | // data: insTb.options.data, |
| | | // initValue: mData ? [mData.tagId] : [], |
| | | // model: {label: {type: 'text'}}, |
| | | // prop: { |
| | | // name: 'name', |
| | | // value: 'id' |
| | | // }, |
| | | // radio: true, |
| | | // clickClose: true, |
| | | // tree: { |
| | | // show: true, |
| | | // indent: 15, |
| | | // strict: false, |
| | | // expandedKeys: true |
| | | // } |
| | | // }); |
| | | // // 弹窗不出现滚动条 |
| | | // $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | // layui.form.render('select'); |
| | | // } |
| | | // }); |
| | | // } |
| | | |
| | | // 模板选择 |
| | | form.on('radio(selectTemplateRadio)', function (data) { |
| | | $('.template-preview').hide(); |
| | |
| | | |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-xs btn-edit layui-btn-primary" lay-event="edit">修改</a> |
| | | <!-- <a class="layui-btn layui-btn-xs btn-edit layui-btn-primary" lay-event="editBarcode">绑定</a>--> |
| | | <button class="layui-btn layui-btn-xs btn-print" lay-event="btnPrint">打印</button> |
| | | </script> |
| | | |
| | |
| | | </form> |
| | | </script> |
| | | |
| | | |
| | | |
| | | <!--<!– 表单弹窗 –>--> |
| | | <!--<script type="text/html" id="editDialogBarcode">--> |
| | | <!-- <form id="detailBarcode" lay-filter="detail" class="layui-form admin-form">--> |
| | | <!-- <input name="id" type="hidden">--> |
| | | <!-- <input name="uuid" type="hidden">--> |
| | | <!-- <input name="nodeId" type="hidden">--> |
| | | <!-- <input name="tag_id" type="hidden">--> |
| | | <!-- <input name="model" type="hidden">--> |
| | | <!-- <input name="name" type="hidden">--> |
| | | <!-- <input name="batch" type="hidden">--> |
| | | <!-- <input name="docId" type="hidden">--> |
| | | <!-- <input name="docNum" type="hidden">--> |
| | | <!-- <input name="custName" type="hidden">--> |
| | | <!-- <input name="itemNum" type="hidden">--> |
| | | <!-- <input name="count" type="hidden">--> |
| | | <!-- <input name="weight" type="hidden">--> |
| | | <!-- <input name="status" type="hidden">--> |
| | | <!-- <input name="createBy" type="hidden">--> |
| | | <!-- <input name="updateTime$" type="hidden">--> |
| | | <!-- <input name="updateBy" type="hidden">--> |
| | | <!-- <div class="layui-row">--> |
| | | |
| | | <!-- <div class="layui-col-md6">--> |
| | | |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">分类</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <div id="tagSelBarcode" class="ew-xmselect-tree"></div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label layui-form-required">型材型号</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input name="maktx" placeholder="请输入型材型号" class="layui-input" lay-vertype="tips" lay-verify="required" required="">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">模具名称</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input name="matnr" placeholder="请输入模具名称" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">套号</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input name="name" placeholder="请输入套号" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <!-- <!– <div class="layui-form-item">–>--> |
| | | <!-- <!– <label class="layui-form-label">开模壁厚</label>–>--> |
| | | <!-- <!– <div class="layui-input-block">–>--> |
| | | <!-- <!– <input name="volume" placeholder="请输入开模壁厚" class="layui-input">–>--> |
| | | <!-- <!– </div>–>--> |
| | | <!-- <!– </div>–>--> |
| | | |
| | | <!-- </div>--> |
| | | |
| | | <!-- <div class="layui-col-md6">--> |
| | | <!-- <!– <div class="layui-form-item">–>--> |
| | | <!-- <!– <label class="layui-form-label layui-form-required">模具名称</label>–>--> |
| | | <!-- <!– <div class="layui-input-block">–>--> |
| | | <!-- <!– <input id="matnr" name="matnr" placeholder="请输入模具名称" class="layui-input" lay-vertype="tips" lay-verify="required" required="">–>--> |
| | | <!-- <!– </div>–>--> |
| | | <!-- <!– </div>–>--> |
| | | |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">规格</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input name="specs" placeholder="请输入代码" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">托盘码</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input name="unit" placeholder="请输入托盘码" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | <!-- <!– <div class="layui-form-item">–>--> |
| | | <!-- <!– <label class="layui-form-label">备注</label>–>--> |
| | | <!-- <!– <div class="layui-input-block">–>--> |
| | | <!-- <!– <input name="memo" placeholder="请输入备注" class="layui-input">–>--> |
| | | <!-- <!– </div>–>--> |
| | | <!-- <!– </div>–>--> |
| | | |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">状态</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input name="color" placeholder="" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!--<!– <div class="layui-form-item">–>--> |
| | | <!--<!– <label class="layui-form-label">状态</label>–>--> |
| | | <!--<!– <div class="layui-input-block">–>--> |
| | | <!--<!– <select id="colorBarcode" name="color" lay-filter="color" placeholder="请选择状态">–>--> |
| | | <!--<!– <option value="">请选择状态</option>–>--> |
| | | <!--<!– <option value="正常" name="color" class="layui-input">正常</option>–>--> |
| | | <!--<!– <option value="报废" name="color" class="layui-input">报废</option>–>--> |
| | | <!--<!– </select>–>--> |
| | | <!--<!– </div>–>--> |
| | | <!--<!– </div>–>--> |
| | | |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <hr class="layui-bg-gray">--> |
| | | <!-- <div class="layui-form-item text-right">--> |
| | | <!-- <button class="layui-btn" lay-filter="editSubmit" lay-submit="">保存</button>--> |
| | | <!-- <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">取消</button>--> |
| | | <!-- </div>--> |
| | | <!-- </form>--> |
| | | <!--</script>--> |
| | | |
| | | <!-- 打印操作弹窗 --> |
| | | <div id="printDataDiv" style="display: none;padding: 20px"> |
| | | <div class="layui-form" style="text-align: center"> |