| | |
| | | if (params.getNotifyType().equals("task")) { |
| | | //任务 |
| | | if (params.getMsgType().equals("task_complete")) { |
| | | mast.setWrkSts(4L); |
| | | if (!Objects.isNull(mast.getWrkCode())) { |
| | | if (mast.getOveMk().equals("N") && mast.getIoType() == 1) { |
| | | throw new CoolException("任务未上报重量,无法完结任务!!"); |
| | | } |
| | | } |
| | | if (mast.getIoType() == 1) { |
| | | mast.setWrkSts(4L); |
| | | } else if (mast.getIoType() == 101) { |
| | | mast.setWrkSts(14L); |
| | | } |
| | | if (!wrkMastService.updateById(mast)) { |
| | | throw new CoolException("任务状态修改失败!!"); |
| | | } |
| | | } else if (params.getMsgType().equals("task_cancel")) { |
| | | |
| | | //todo 取消任务 |
| | | } |
| | | } else if (params.getNotifyType().equals("weight")) { |
| | | //称重 |
| | |
| | | //余料长度 |
| | | wrkDetl.setRealQty(val * matnr.getVolume()); |
| | | mast.setIoType(1); |
| | | mast.setOveMk("Y"); |
| | | mast.setIsSuplus(1); |
| | | if (!wrkMastService.updateById(mast)) { |
| | | throw new CoolException("主档状态修改失败"); |
| | |
| | | throw new CoolException("物料基础信息不存在!!"); |
| | | } |
| | | Double val = Math.round((params.getWeight() - matnr.getSafeQty()) * 10000) / 10000.0; |
| | | //称重后,计算出真实长度 |
| | | Double realQty = val * matnr.getVolume(); |
| | | // if (val.compareTo(0.0) > 0) { |
| | | // //余料长度 |
| | |
| | | if (Objects.isNull(orgWrk)) { |
| | | throw new CoolException("数据错误,主任务档不存在或已删除!!"); |
| | | } |
| | | orgWrk.setOveMk("Y"); |
| | | if (!wrkMastService.updateById(orgWrk)) { |
| | | throw new CoolException("任务档修改失败!!"); |
| | | } |
| | | WrkDetl detl = wrkDetlService.selectOne(new EntityWrapper<WrkDetl>().eq("wrk_no", wrkNo)); |
| | | if (Objects.isNull(detl)) { |
| | | throw new CoolException("子任务档明细不存在!!"); |
| | | } |
| | | //库存减去称重长度 |
| | | Double v = Math.round((wrkDetl.getStockQty() - realQty) * 10000) / 10000.0; |
| | | detl.setRealQty(v); |
| | | //原出为数量与真实数量互换,保持一致性 |
| | | detl.setRealQty(detl.getAnfme()); |
| | | detl.setAnfme(v); |
| | | detl.setWeight(params.getWeight()); |
| | | if (!wrkDetlService.update(detl, new EntityWrapper<WrkDetl>().eq("wrk_no", wrkNo).eq("matnr", detl.getMatnr()).eq("barcode", detl.getBarcode()))) { |
| | | throw new CoolException("原任务档明细修改失败!!"); |
| | |
| | | wrkDetls.forEach(wrkDetl -> { |
| | | WrkDetl wrkDetl1 = new WrkDetl(); |
| | | BeanUtils.copyProperties(wrkDetl, wrkDetl1); |
| | | wrkDetl1.setAnfme(wrkDetl.getStockQty() - wrkDetl.getAnfme()); |
| | | wrkDetl1.setWrkNo(wokNo); |
| | | if (!wrkDetlService.insert(wrkDetl1)) { |
| | | throw new CoolException("任务档明细保存失败!!"); |
| | |
| | | } |
| | | } |
| | | , { |
| | | field: 'realQty', align: 'center', title: '实际数量', hide: false, templet: function (d) { |
| | | field: 'realQty', align: 'center', title: '单据数量', hide: true, templet: function (d) { |
| | | var raw = d.realQty; |
| | | // var ioType = d.ioType; |
| | | // console.log(ioType) |
| | |
| | | ,{field: 'staNo$', align: 'center',title: '目标站', width: 95} |
| | | ,{field: 'sourceLocNo', align: 'center',title: '源库位', width: 120} |
| | | ,{field: 'locNo', align: 'center',title: '目标库位', width: 120} |
| | | ,{field: 'oveMk', align: 'center',title: '是否称重', width: 120} |
| | | ,{field: 'preHave', align: 'center',title: '先入品', hide: true} |
| | | ,{field: 'takeNone', align: 'center',title: '空操作', hide: true} |
| | | ,{field: 'isSuplus$', align: 'center', title: '回库类型', hide: false, width: 120} |