| | |
| | | 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); |