| | |
| | | private MatService matService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | |
| | | /* |
| | | * 物料托盘绑定分页查询 |
| | | * */ |
| | | * 物料托盘绑定分页查询 |
| | | * */ |
| | | @RequestMapping(value = "/barcodeMatnr/list/auth") |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | public R list(@RequestParam(defaultValue = "1") Integer curr, |
| | | @RequestParam(defaultValue = "10") Integer limit, |
| | | @RequestParam(required = false) String orderByField, |
| | | @RequestParam(required = false) String orderByType, |
| | | @RequestParam Map<String, Object> param) { |
| | | excludeTrash(param); |
| | | EntityWrapper<MatBarcode> wrapper = new EntityWrapper<>(); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | else { |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } else { |
| | | wrapper.orderBy("modi_time", false); |
| | | } |
| | | return R.ok(matBarcodeService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper) { |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | if (val.contains(RANGE_TIME_LINK)) { |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | |
| | | } |
| | | |
| | | /* |
| | | * 物料托盘解绑 |
| | | * */ |
| | | * 物料托盘解绑 |
| | | * */ |
| | | @RequestMapping("/barcodeMatnr/matnrLostBarcode") |
| | | @ManagerAuth(memo = "物料托盘解绑") |
| | | public R matnrLostBarcode(@RequestBody List<MatBarcode> list) { |
| | |
| | | } |
| | | |
| | | /* |
| | | * 批量组托 |
| | | * */ |
| | | * 批量组托 |
| | | * */ |
| | | @RequestMapping("/barcodeMatnr/matnrAndBarcode") |
| | | @ManagerAuth(memo = "物料托盘批量组托") |
| | | public R matnrAndBarcode(@RequestBody List<MatBarcode> list) { |
| | | if (Cools.isEmpty(list)){ |
| | | if (Cools.isEmpty(list)) { |
| | | return R.error(BaseRes.PARAM); |
| | | } |
| | | for (MatBarcode matBarcode : list) { |
| | | if (!matBarcode.getZpallet().equals(list.get(0).getZpallet())){ |
| | | if (!matBarcode.getZpallet().equals(list.get(0).getZpallet())) { |
| | | log.info(matBarcode.getZpallet()); |
| | | log.info(list.get(0).getZpallet()); |
| | | throw new CoolException("请选择相同托盘码的数据"); |
| | |
| | | } |
| | | |
| | | /*物料托盘绑定 |
| | | * |
| | | * */ |
| | | * |
| | | * */ |
| | | @RequestMapping(value = "/barcodeMatnr/add/auth") |
| | | @ManagerAuth |
| | | public R add(WaitPakin waitPakin) { |
| | | if (Cools.isEmpty(waitPakin.getBarcode())||Cools.isEmpty(waitPakin.getModiUser())){ |
| | | if (Cools.isEmpty(waitPakin.getBarcode()) || Cools.isEmpty(waitPakin.getModiUser())) { |
| | | return R.error(BaseRes.PARAM); |
| | | } |
| | | matBarcodeService.addBarcodeMatnr(waitPakin); |
| | |
| | | } |
| | | |
| | | /*组托 |
| | | * |
| | | * */ |
| | | * |
| | | * */ |
| | | @RequestMapping(value = "/barcodeMatnr/comb/auth") |
| | | @ManagerAuth |
| | | public R comb(WaitPakin waitPakin) { |
| | | Mat mat = matService.selectById(waitPakin.getModiUser()); |
| | | MatBarcode matBarcode = matBarcodeService.selectbyMatnr(mat.getMatnr()); |
| | | if (matBarcode == null){ |
| | | if (matBarcode == null) { |
| | | throw new CoolException("该物料未与托盘绑定"); |
| | | }else { |
| | | if (!matBarcode.getZpallet().equals(waitPakin.getBarcode())){ |
| | | throw new CoolException("该物料与其他托盘绑定,不能与当前托盘"+waitPakin.getBarcode()+"绑定,与该物料绑定的托盘是"+matBarcode.getZpallet()); |
| | | } else { |
| | | if (!matBarcode.getZpallet().equals(waitPakin.getBarcode())) { |
| | | throw new CoolException("该物料与其他托盘绑定,不能与当前托盘" + waitPakin.getBarcode() + "绑定,与该物料绑定的托盘是" + matBarcode.getZpallet()); |
| | | } |
| | | } |
| | | if (mat.getColor().equals("报废")){ |
| | | if (mat.getColor().equals("报废")) { |
| | | throw new CoolException("该物料已报废,请勿绑定"); |
| | | } |
| | | if (Cools.isEmpty(waitPakin.getBarcode())||Cools.isEmpty(waitPakin.getModiUser())||Cools.isEmpty(waitPakin.getAnfme())){ |
| | | if (Cools.isEmpty(waitPakin.getBarcode()) || Cools.isEmpty(waitPakin.getModiUser()) || Cools.isEmpty(waitPakin.getAnfme())) { |
| | | return R.error(BaseRes.PARAM); |
| | | } |
| | | mobileService.combToWms(waitPakin); |
| | |
| | | } |
| | | |
| | | /*并板 |
| | | * |
| | | * */ |
| | | * |
| | | * */ |
| | | // @RequestMapping(value = "/barcodeMatnr/clamp/auth") |
| | | @ManagerAuth |
| | | public R clamp(WaitPakin waitPakin) { |
| | | if (Cools.isEmpty(waitPakin.getBarcode())||Cools.isEmpty(waitPakin.getModiUser())){ |
| | | if (Cools.isEmpty(waitPakin.getBarcode()) || Cools.isEmpty(waitPakin.getModiUser())) { |
| | | return R.error(BaseRes.PARAM); |
| | | } |
| | | Mat mat = matService.selectById(waitPakin.getModiUser()); |
| | | MatBarcode matBarcode = matBarcodeService.selectbyMatnr(mat.getMatnr()); |
| | | if (matBarcode == null){ |
| | | if (matBarcode == null) { |
| | | throw new CoolException("该物料未与托盘绑定"); |
| | | }else { |
| | | if (!matBarcode.getZpallet().equals(waitPakin.getBarcode())){ |
| | | throw new CoolException("该物料与其他托盘绑定,不能与当前托盘"+waitPakin.getBarcode()+"绑定,与该物料绑定的托盘是"+matBarcode.getZpallet()); |
| | | } else { |
| | | if (!matBarcode.getZpallet().equals(waitPakin.getBarcode())) { |
| | | throw new CoolException("该物料与其他托盘绑定,不能与当前托盘" + waitPakin.getBarcode() + "绑定,与该物料绑定的托盘是" + matBarcode.getZpallet()); |
| | | } |
| | | } |
| | | MobileAdjustParam combParam=new MobileAdjustParam(); |
| | | ArrayList<CombParam.CombMat> combMats=new ArrayList<>(); |
| | | CombParam.CombMat combMat=new CombParam.CombMat(); |
| | | MobileAdjustParam combParam = new MobileAdjustParam(); |
| | | ArrayList<CombParam.CombMat> combMats = new ArrayList<>(); |
| | | CombParam.CombMat combMat = new CombParam.CombMat(); |
| | | combMat.setMatnr(mat.getMatnr()); |
| | | combMat.setMaktx(mat.getMaktx()); |
| | | // combMat.setAnfme(waitPakin.getAnfme()); |
| | |
| | | /*批量并板*/ |
| | | @RequestMapping(value = "/barcodeMatnr/clamp/auth") |
| | | @ManagerAuth |
| | | public R clamp2(@RequestBody List<MatBarcode> list){ |
| | | if (Cools.isEmpty(list)){ |
| | | public R clamp2(@RequestBody List<MatBarcode> list) { |
| | | if (Cools.isEmpty(list)) { |
| | | return R.error(BaseRes.PARAM); |
| | | } |
| | | for (MatBarcode matBarcode : list) { |
| | | MobileAdjustParam combParam=new MobileAdjustParam(); |
| | | ArrayList<CombParam.CombMat> combMats=new ArrayList<>(); |
| | | CombParam.CombMat combMat=new CombParam.CombMat(); |
| | | MobileAdjustParam combParam = new MobileAdjustParam(); |
| | | ArrayList<CombParam.CombMat> combMats = new ArrayList<>(); |
| | | CombParam.CombMat combMat = new CombParam.CombMat(); |
| | | combMat.setMatnr(matBarcode.getMatnr()); |
| | | combMat.setMaktx(matBarcode.getMaktx()); |
| | | combMat.setAnfme(1.0); |
| | |
| | | |
| | | import com.alibaba.excel.context.AnalysisContext; |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.common.SpringUtils; |
| | | import com.core.exception.CoolException; |
| | |
| | | |
| | | } |
| | | //模具信息更新 |
| | | matService.deleteById(mat.getId()); |
| | | matService.delete(new EntityWrapper<Mat>().eq("matnr",mat.getMatnr())); |
| | | mat = excel; |
| | | mat.setTagId(tagId); |
| | | mat.setMatnr(excel.getMatnr()+"__"+excel.getName()); |
| | | mat.setMatnr(excel.getMatnr() + "__" + excel.getName()); |
| | | if (!matService.insert(mat)) { |
| | | throw new CoolException("保存商品档案失败,商品编码:" + excel.getMatnr()); |
| | | } |
| | |
| | | ,{field: 'batch', align: 'center',title: '批次', hide:true,sort:true} |
| | | ,{field: 'outOrderNo', align: 'center',title: '合同号', sort:true, hide: true} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | | ,{field: 'anfme', align: 'center',title: '数量', hide: false} |
| | | ,{field: 'anfme', align: 'center',title: '数量', hide: true} |
| | | ,{field: 'zpallet', align: 'center',title: '托盘条码', hide: false} |
| | | ,{field: 'specs', align: 'center',title: '规格', hide: false} |
| | | ,{field: 'color', 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: 'length', align: 'center',title: '单箱毛重', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '理论克重', hide: true, edit:'text', width: 130, style:'color: blue;font-weight: bold'} |
| | | ,{field: 'length', align: 'center',title: '实际克重', hide: true, edit:'text', width: 130, style:'color: blue;font-weight: bold'} |
| | | ,{field: 'volume', align: 'center',title: '单箱体积', hide: true} |
| | | ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true} |
| | | ,{field: 'supp', align: 'center',title: '客户名称', hide:false } |
| | | ,{field: 'supp', align: 'center',title: '客户名称', hide:true } |
| | | ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: true} |
| | | ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true} |
| | | ,{field: 'deadTime', 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: 'proType', align: 'center',title: '属性', hide: false} |
| | | ,{field: 'proType', align: 'center',title: '属性', hide: true} |
| | | ,{field: 'temp1', align: 'center',title: '名称总称', hide: true} |
| | | ,{field: 'temp2', align: 'center',title: '客户图号', hide: true} |
| | | |
| | |
| | | <!-- <option style="display: none"></option>--> |
| | | <option value=""></option> |
| | | <option value="1">低库位</option> |
| | | <option value="2">高库位</option> |
| | | <option value="2">中库位</option> |
| | | <option value="5">高库位</option> |
| | | <option value="6">超高库位</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | </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="matnr" placeholder="商品模具名称" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | <select name="loc_type1" id="loc_type1" class="layui-input" type="text" placeholder="库位类型" autocomplete="off"> |
| | | <!-- <option style="display: none"></option>--> |
| | | <option value=""></option> |
| | | <option value="1">小库位</option> |
| | | <option value="2">大库位</option> |
| | | <option value="1">低库位</option> |
| | | <option value="2">中库位</option> |
| | | <option value="5">高库位</option> |
| | | <option value="6">超高库位</option> |
| | | </select> |
| | | </div> |
| | | </div> |