| | |
| | | for (Object o : jsonArray){ |
| | | JSONObject jsonObject = (JSONObject)o; |
| | | String batch = jsonObject.get("batch").toString(); |
| | | Integer packageNo = Integer.parseInt(json.get("packageNo").toString()); |
| | | Integer packageNo = Integer.parseInt(jsonObject.get("packageNo").toString()); |
| | | if(Cools.isEmpty(locNo) || Cools.isEmpty(batch) || Cools.isEmpty(packageNo)){ |
| | | return R.error("有参数为空,无法入库"); |
| | | } |
| | |
| | | |
| | | String s = "2024010502"; |
| | | System.out.println(s.substring(8,10)); |
| | | |
| | | Object s1 = "8"; |
| | | System.out.println(Integer.parseInt(s1.toString())); |
| | | } |
| | | |
| | | } |
| | |
| | | public R query(String condition) { |
| | | EntityWrapper<Order> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("order_no", condition); |
| | | wrapper.le("settle",3); |
| | | Page<Order> page = orderService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Order order : page.getRecords()){ |
| | |
| | | } |
| | | Pla pla = plaService.selectByBatchAndPackageNo(excel.getBatch(),excel.getPackageNo()); |
| | | if (pla == null) { |
| | | pla = excel; |
| | | pla.setStep(2); |
| | | pla.setCreateTime(new Date()); |
| | | pla.setModifyTime(new Date()); |
| | | pla.setStatus(GlobleParameter.PLA_STATUS_00); |
| | | pla.setStockFreeze(1); |
| | | pla.setWeightAnfme(pla.getWeight()); |
| | | Mat mat = matService.selectByMaktx(pla.getBrand()); |
| | | if(Cools.isEmpty(mat)){ |
| | | throw new CoolException("无法找到对应的牌号信息,牌号=" + pla.getBrand()); |
| | | } |
| | | pla.setMatnr(mat.getMatnr()); |
| | | try { |
| | | pla.setType(getType(mat.getMatnr())); |
| | | //车间、产线、主体 |
| | | setPla(pla); |
| | | }catch (Exception e){ |
| | | log.info(e.getMessage() + "Pla: " + pla.getBatch()); |
| | | throw new CoolException(e.getMessage() + ",批号:" + excel.getBatch() + ", 包号:" + excel.getPackageNo()); |
| | | } |
| | | |
| | | if(!Cools.isEmpty(pla.getLocNo())){ |
| | | Node node = nodeService.selectByUuid(pla.getLocNo()); |
| | | if(Cools.isEmpty(node)){ |
| | | throw new CoolException("未能找到相应的库位信息,库位编号=" +pla.getLocNo()); |
| | | //log.info("未能找到相应的库位信息,库位编号={}",pla.getLocNo()); |
| | | } |
| | | pla.setStash(node.getParentName()); |
| | | pla.setLocNo(node.getUuid()); |
| | | pla.setStatus(GlobleParameter.PLA_STATUS_1); |
| | | pla.setPakinTime(new Date()); |
| | | } |
| | | plaCreate(pla,excel,matService,nodeService); |
| | | try { |
| | | plaService.insert(pla); |
| | | }catch (Exception e){ |
| | |
| | | // throw new CoolException("保存商品信息失败,商品编码:" + excel.getMatnr()); |
| | | // } |
| | | total++; |
| | | }else if (pla.getStatus().equals(GlobleParameter.PLA_STATUS_00)){ |
| | | }else if(Cools.eq(pla.getStatus(),GlobleParameter.PLA_STATUS_0) || Cools.eq(pla.getStatus(),GlobleParameter.PLA_STATUS_1) || Cools.eq(pla.getStatus(),GlobleParameter.PLA_STATUS_00)){ |
| | | excel.setId(pla.getId()); |
| | | excel.setCreateTime(pla.getCreateTime()); |
| | | excel.setModifyTime(new Date()); |
| | | excel.setStep(2); |
| | | excel.setStatus(GlobleParameter.PLA_STATUS_00); |
| | | excel.setStatus(pla.getStatus()); |
| | | excel.setPakinTime(pla.getPakinTime()); |
| | | excel.setStash(pla.getStash()); |
| | | excel.setLocNo(pla.getLocNo()); |
| | | BeanUtils.copyProperties(excel,pla); |
| | | pla = plaCreate(pla,excel,matService,nodeService); |
| | | try { |
| | | plaService.updateById(pla); |
| | | }catch (Exception e){ |
| | |
| | | String batch = pla.getBatch(); |
| | | String line = batch.substring(8,10); |
| | | |
| | | pla.setLine(line); |
| | | if("纯树脂".equals(pla.getType())){ |
| | | if("01".equals(line) || "02".equals(line)){ |
| | | pla.setOwner(OWNER_HZ); |
| | | pla.setWorkshop("一车间"); |
| | | }else { |
| | | pla.setOwner(OWNER_HNE); |
| | | pla.setWorkshop("三车间"); |
| | | } |
| | | }else if ("改性树脂".equals(pla.getType())){ |
| | | if ("01".equals(line) || "02".equals(line) || "03".equals(line) || "04".equals(line)){ |
| | | pla.setOwner(OWNER_HNE); |
| | | pla.setWorkshop("二车间"); |
| | | if(Cools.isEmpty(pla.getLine())){ |
| | | pla.setLine(line); |
| | | } |
| | | |
| | | if(Cools.isEmpty(pla.getOwner()) && Cools.isEmpty(pla.getWorkshop())){ |
| | | if("纯树脂".equals(pla.getType())){ |
| | | if("01".equals(line) || "02".equals(line)){ |
| | | pla.setOwner(OWNER_HZ); |
| | | pla.setWorkshop("一车间"); |
| | | }else { |
| | | pla.setOwner(OWNER_HNE); |
| | | pla.setWorkshop("三车间"); |
| | | } |
| | | }else if ("改性树脂".equals(pla.getType())){ |
| | | if ("01".equals(line) || "02".equals(line) || "03".equals(line) || "04".equals(line)){ |
| | | pla.setOwner(OWNER_HNE); |
| | | pla.setWorkshop("二车间"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | public int getTotal() { |
| | | return total; |
| | | } |
| | | |
| | | private Pla plaCreate(Pla pla, PlaExcel excel, MatService matService, NodeService nodeService){ |
| | | pla = excel; |
| | | pla.setStep(2); |
| | | pla.setModifyTime(new Date()); |
| | | pla.setStatus(GlobleParameter.PLA_STATUS_00); |
| | | pla.setStockFreeze(1); |
| | | pla.setWeightAnfme(pla.getWeight()); |
| | | Mat mat = matService.selectByMaktx(pla.getBrand()); |
| | | if(Cools.isEmpty(mat)){ |
| | | throw new CoolException("无法找到对应的牌号信息,牌号=" + pla.getBrand()); |
| | | } |
| | | pla.setMatnr(mat.getMatnr()); |
| | | try { |
| | | if(Cools.isEmpty(pla.getType())){ |
| | | pla.setType(getType(mat.getMatnr())); |
| | | } |
| | | //车间、产线、主体 |
| | | setPla(pla); |
| | | }catch (Exception e){ |
| | | log.info(e.getMessage() + "Pla: " + pla.getBatch()); |
| | | throw new CoolException(e.getMessage() + ",批号:" + excel.getBatch() + ", 包号:" + excel.getPackageNo()); |
| | | } |
| | | |
| | | if(!Cools.isEmpty(pla.getLocNo())){ |
| | | Node node = nodeService.selectByUuid(pla.getLocNo()); |
| | | if(Cools.isEmpty(node)){ |
| | | throw new CoolException("未能找到相应的库位信息,库位编号=" +pla.getLocNo()); |
| | | //log.info("未能找到相应的库位信息,库位编号={}",pla.getLocNo()); |
| | | } |
| | | pla.setStash(node.getParentName()); |
| | | pla.setLocNo(node.getUuid()); |
| | | pla.setStatus(GlobleParameter.PLA_STATUS_1); |
| | | pla.setPakinTime(new Date()); |
| | | } |
| | | |
| | | return pla; |
| | | } |
| | | } |
| | |
| | | var cols = [ |
| | | {field: 'brand', align: 'center',title: '牌号', style: 'font-weight: bold'}, |
| | | {field: 'matnr', align: 'center',title: '商品编号', style: 'font-weight: bold'}, |
| | | {field: 'weight', align: 'center',title: '库存数量', style: 'font-weight: bold'} |
| | | {field: 'weight', align: 'center',title: '库存重量(KG)', style: 'font-weight: bold'} |
| | | ]; |
| | | // arrRemove(detlCols, "field", "anfme") |
| | | // arrRemove(detlCols, "field", "zpallet") |
| | |
| | | limits: [20, 30, 50, 100, 200, 500], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | defaultToolbar: ['filter', 'exports', 'print', { |
| | | title: '提示', |
| | | layEvent: 'LAYTABLE_TIPS', |
| | | icon: 'layui-icon-tips' |
| | | }], |
| | | cellMinWidth: 50, |
| | | cols: [getCol()], |
| | | request: { |
| | |
| | | ,{align: 'center', title: '二维码', toolbar: '#operate', width: 200 , hide:true} |
| | | ,{align: 'center', title: '明细', toolbar: '#tbLook', minWidth: 160, width: 160} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | // ,{field: 'custName', align: 'center',title: '客户名称', width: 160} |
| | | ,{field: 'custName', align: 'center',title: '客户名称', width: 160} |
| | | ,{field: 'createTime$', align: 'center',title: '操作时间'} |
| | | ,{align: 'center', title: '操作', toolbar: '#operate'} |
| | | |
| | |
| | | }, |
| | | //height: 'full', |
| | | limit: 16, |
| | | limits: [16, 30, 50, 100, 200, 500], |
| | | limits: [ 50, 100, 200, 500,2000,5000,10000], |
| | | even: true, |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | |
| | | ,{field: 'id', align: 'center',title: 'id', hide:true} |
| | | ,{field: 'locNo', align: 'center',title: '库位'} |
| | | ,{field: 'type$', align: 'center',title: '操作类型'} |
| | | ,{field: 'matnr', align: 'center',title: '物料号'} |
| | | ,{field: 'matnr', align: 'center',title: '牌号'} |
| | | ,{field: 'batch', align: 'center',title: '批号'} |
| | | ,{field: 'packageNo', align: 'center',title: '包号'} |
| | | ,{field: 'targetLocNo', align: 'center',title: '目标库位'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'createByName', align: 'center',title: '操作人'} |
| | | // ,{field: 'createByName', align: 'center',title: '操作人'} |
| | | ,{field: 'ioTime$', align: 'center',title: '操作时间'} |
| | | ,{field: 'createBy', align: 'center',title: '', hide:true} |
| | | |
| | |
| | | </div> |
| | | <script type="text/html" id="toolbar"> |
| | | |
| | | <div class="layui-btn-container layui-col-md1"> |
| | | <button class="layui-btn" lay-event="exportAll" style="margin-top: -0px">导出全部</button> |
| | | </div> |
| | | <!-- <div class="layui-btn-container layui-col-md1">--> |
| | | <!-- <button class="layui-btn" lay-event="exportAll" style="margin-top: -0px">导出全部</button>--> |
| | | <!-- </div>--> |
| | | </script> |
| | | |
| | | |