| | |
| | | return R.error("未找到此条码"); |
| | | } |
| | | |
| | | ArrayList<HashMap<String, Object>> list = new ArrayList<>(); |
| | | List<String> orderNos = new ArrayList<>(); |
| | | List<HashMap<String, Object>> list = new ArrayList<>(); |
| | | for (NccXsckmxTkWms nccXsckmxTkWms : nccXsckmxTkWmsList) { |
| | | if (orderNos.contains(nccXsckmxTkWms.getVsourcebillcode())) { |
| | | continue; |
| | | } |
| | | orderNos.add(nccXsckmxTkWms.getVsourcebillcode()); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | |
| | | Mat mat = matService.selectByMatnr(nccXsckmxTkWms.getWlbm()); |
| | | if (mat == null) { |
| | | continue; |
| | | } |
| | | MatParam matParam = new MatParam(); |
| | | Synchro.Copy(mat, matParam); |
| | | matParam.setBatch(nccXsckmxTkWms.getVbatchcode()); |
| | |
| | | locDto.setBoxType2(orderDetl.getBoxType2()); |
| | | locDto.setBoxType3(orderDetl.getBoxType3()); |
| | | locDto.setWeight(orderDetl.getWeight()); |
| | | locDto.setUnit(orderDetl.getUnit()); |
| | | |
| | | locDto.setStaNos(staNos); |
| | | locDtos.add(locDto); |
| | |
| | | locDto.setBoxType2(orderDetl.getBoxType2()); |
| | | locDto.setBoxType3(orderDetl.getBoxType3()); |
| | | locDto.setWeight(orderDetl.getWeight()); |
| | | locDto.setUnit(orderDetl.getUnit()); |
| | | locDto.setLack(Boolean.TRUE); |
| | | locDtos.add(locDto); |
| | | } |
| | |
| | | locDto.setBoxType2(orderDetl.getBoxType2()); |
| | | locDto.setBoxType3(orderDetl.getBoxType3()); |
| | | locDto.setWeight(orderDetl.getWeight()); |
| | | locDto.setUnit(orderDetl.getUnit()); |
| | | locDtos.add(locDto); |
| | | exist.add(locDetl.getLocNo()); |
| | | // 剩余待出数量递减 |
| | |
| | | locDto.setBoxType2(orderDetl.getBoxType2()); |
| | | locDto.setBoxType3(orderDetl.getBoxType3()); |
| | | locDto.setWeight(orderDetl.getWeight()); |
| | | locDto.setUnit(orderDetl.getUnit()); |
| | | locDto.setLack(Boolean.TRUE); |
| | | locDtos.add(locDto); |
| | | } |
| | |
| | | |
| | | int updateAnfme(@Param("anfme")Double anfme, @Param("wrkNo")Integer wrkNo, @Param("matnr")String matnr, @Param("batch")String batch); |
| | | |
| | | int updateWeight(@Param("weight")Double weight, @Param("wrkNo")Integer wrkNo, @Param("matnr")String matnr, @Param("batch")String batch); |
| | | |
| | | List<WrkDetl> selectAndLogByOrderNo(String orderNo); |
| | | |
| | | int updateInspect( @Param("wrkNo")Integer wrkNo, @Param("matnr")String matnr, @Param("batch")String batch); |
| | |
| | | |
| | | void report(Order order, List<OrderDetl> orderDetls, DocType docType) throws Exception; |
| | | |
| | | void reportTkrk(String batch, Double anfme); |
| | | void reportTkrk(String batch, String orderNo, Double anfme); |
| | | |
| | | } |
| | |
| | | |
| | | //转换关系 |
| | | String origin = mat.getOrigin(); |
| | | if (Cools.isEmpty(origin)) { |
| | | return true; |
| | | } |
| | | String[] split = origin.split("/"); |
| | | //辅单位 |
| | | Double weight = (anfme / Double.parseDouble(split[1])) / Double.parseDouble(split[0]); |
| | |
| | | if (!wrkDetlService.insert(wrkDetl)) { |
| | | throw new CoolException("添加" + wrkMast.getWrkNo() + "盘点任务," + wrkDetl.getMatnr() + "商品," + wrkDetl.getBatch() + "批号任务明细失败"); |
| | | } |
| | | } |
| | | List<WrkDetl> wrkDetls1 = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()); |
| | | for (WrkDetl wrkDetl : wrkDetls1) { |
| | | LocDetlAdjustParam.LocDetlAdjust locDetlAdjust = new LocDetlAdjustParam.LocDetlAdjust(wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getAnfme()); |
| | | locDetlAdjusts.add(locDetlAdjust); |
| | | |
| | | String locNo = Cools.isEmpty(wrkMast.getLocNo()) ? wrkMast.getSourceLocNo() : wrkMast.getLocNo(); |
| | | List<InventoryCheckOrderDetl> checkOrderDetls = inventoryCheckOrderDetlService.selectList(new EntityWrapper<InventoryCheckOrderDetl>().eq("loc_no", locNo)); |
| | | for (InventoryCheckOrderDetl checkOrderDetl : checkOrderDetls) { |
| | | if (wrkDetl.getMatnr().equals(checkOrderDetl.getMatnr()) && Cools.eq(wrkDetl.getBatch(), checkOrderDetl.getBatch())) { |
| | | checkOrderDetl.setCheckAnfme(wrkDetl.getAnfme()); |
| | | checkOrderDetl.setStatus("2"); |
| | | } else { |
| | | InventoryCheckOrderDetl newDetl = new InventoryCheckOrderDetl(); |
| | | Synchro.Copy(wrkDetl, newDetl); |
| | | newDetl.setAnfme(0D); |
| | | newDetl.setCheckAnfme(wrkDetl.getAnfme()); |
| | | newDetl.setOrderNo(checkOrderDetl.getOrderNo()); |
| | | newDetl.setStatus("2"); |
| | | inventoryCheckOrderDetlService.updateById(checkOrderDetl); |
| | | } |
| | | } |
| | | } |
| | | List<WrkDetl> wrkDetls1 = wrkDetlService.selectByWrkNo(wrkMast.getWrkNo()); |
| | | for (WrkDetl wrkDetl : wrkDetls1) { |
| | | LocDetlAdjustParam.LocDetlAdjust locDetlAdjust = new LocDetlAdjustParam.LocDetlAdjust(wrkDetl.getMatnr(), wrkDetl.getBatch(), wrkDetl.getAnfme()); |
| | | locDetlAdjusts.add(locDetlAdjust); |
| | | } |
| | | // 修改盘点任务主档状态 |
| | | wrkMast.setFullPlt(wrkDetls1.size() != 0 ? "Y" : "N"); |
| | |
| | | orderDetl.setLineNumber(detlDto.getLineNumber()); |
| | | orderDetl.setBatch(detlDto.getBatch()); |
| | | orderDetl.setAnfme(detlDto.getAnfme()); |
| | | orderDetl.setWeight(detlDto.getWeight()); |
| | | orderDetl.setBrand(detlDto.getBrand()); |
| | | orderDetl.setStandby1(detlDto.getStandby1()); |
| | | orderDetl.setStandby2(detlDto.getStandby2()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void reportTkrk(String batch, Double anfme) { |
| | | Object process1 = processTKRK(batch, anfme); |
| | | public void reportTkrk(String batch, String orderNo, Double anfme) { |
| | | Object process1 = processTKRK(batch, orderNo, anfme); |
| | | //发送请求 |
| | | NcResultMessage response = SendUtil.sendDataToNc(SendUtil.token, nyncIp + ":" + port, saveRefDelivery, JSONObject.toJSONString(process1)); |
| | | log.info("销售发货response:{}", response); |
| | |
| | | return data; |
| | | } |
| | | |
| | | private Object processTKRK(String batch, Double anfme) { |
| | | private Object processTKRK(String batch, String orderNo, Double anfme) { |
| | | EntityWrapper<NccXsckmxTkWms> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("VBATCHCODE", batch); |
| | | wrapper.eq("VBATCHCODE", batch).eq("VSOURCEBILLCODE", orderNo); |
| | | NccXsckmxTkWms nccXsckmxTkWms = nccXsckmxTkWmsService.selectOne(wrapper); |
| | | if (null == nccXsckmxTkWms) { |
| | | throw new CoolException("未找到此条码"); |
| | | } |
| | | |
| | | NccSaleXsfhmxWms nccSaleXsfhmxWms = nccSaleXsfhmxWmsService.selectOne(new EntityWrapper<NccSaleXsfhmxWms>() |
| | | .eq("VBILLCODE", nccXsckmxTkWms.getVsourcebillcode())); |
| | | .eq("VBILLCODE", nccXsckmxTkWms.getVsourcebillcode()) |
| | | .eq("WLBM", nccXsckmxTkWms.getWlbm()) |
| | | ); |
| | | if(null == nccSaleXsfhmxWms) { |
| | | throw new CoolException("未找到销售单据"); |
| | | } |
| | |
| | | if (anfme <= 0) { |
| | | return this.baseMapper.deleteItem(wrkNo, matnr, batch) > 0; |
| | | } else { |
| | | return baseMapper.updateAnfme(anfme, wrkNo, matnr, batch) > 0; |
| | | boolean result = baseMapper.updateAnfme(anfme, wrkNo, matnr, batch) > 0; |
| | | if (!result) { |
| | | return false; |
| | | } |
| | | |
| | | //更新辅料 |
| | | Mat mat = matService.selectByMatnr(matnr); |
| | | if (mat == null) { |
| | | return false; |
| | | } |
| | | |
| | | //转换关系 |
| | | String origin = mat.getOrigin(); |
| | | if (Cools.isEmpty(origin)) { |
| | | return true; |
| | | } |
| | | String[] split = origin.split("/"); |
| | | //辅单位 |
| | | Double weight = (anfme / Double.parseDouble(split[1])) / Double.parseDouble(split[0]); |
| | | return baseMapper.updateWeight(weight, wrkNo, matnr, batch) > 0; |
| | | } |
| | | } |
| | | |
| | |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private WrkMastService wrkMastService; |
| | | @Autowired |
| | | private InventoryCheckOrderDetlService inventoryCheckOrderDetlService; |
| | | |
| | | @Autowired |
| | |
| | | // 入库通知单 |
| | | if (!Cools.isEmpty(wrkMast.getBarcode())) { |
| | | WaitPakin waitPakin = waitPakinService.selectOne(new EntityWrapper<WaitPakin>().eq("zpallet", wrkMast.getBarcode())); |
| | | if ("Y".equals(waitPakin.getTkFlag())) { |
| | | reportToThirdService.reportTkrk(waitPakin.getBatch(), waitPakin.getAnfme()); |
| | | if (!Cools.isEmpty(waitPakin.getTkFlag())) { |
| | | reportToThirdService.reportTkrk(waitPakin.getBatch(), waitPakin.getTkFlag(), waitPakin.getAnfme()); |
| | | } |
| | | |
| | | // 保存入库通知档历史档 |
| | |
| | | } |
| | | for (DetlDto detlDto : detlDtos) { |
| | | if (detlDtoB.getMatnr().equals(detlDto.getMatnr()) && Cools.eq(detlDtoB.getBatch(), detlDto.getBatch()) |
| | | && detlDtoB.getBrand().equals(detlDto.getBrand()) && detlDtoB.getStandby1().equals(detlDto.getStandby1()) |
| | | // && detlDtoB.getBrand().equals(detlDto.getBrand()) |
| | | && detlDtoB.getStandby1().equals(detlDto.getStandby1()) |
| | | && detlDtoB.getStandby2().equals(detlDto.getStandby2()) && detlDtoB.getStandby3().equals(detlDto.getStandby3()) |
| | | && detlDtoB.getBoxType1().equals(detlDto.getBoxType1()) && detlDtoB.getBoxType2().equals(detlDto.getBoxType2()) |
| | | && detlDtoB.getBoxType3().equals(detlDto.getBoxType3())) { |
| | |
| | | |
| | | private Double weight; |
| | | |
| | | private String unit; |
| | | |
| | | |
| | | public LocDto() { |
| | | } |
| | |
| | | <include refid="batchSeq"></include> |
| | | </update> |
| | | |
| | | <update id="updateWeight"> |
| | | update asr_wrk_detl |
| | | set weight = #{weight} |
| | | , modi_time = getdate() |
| | | where 1=1 |
| | | and wrk_no = #{wrkNo} |
| | | and matnr = #{matnr} |
| | | <include refid="batchSeq"></include> |
| | | </update> |
| | | |
| | | <select id="selectAndLogByOrderNo" resultMap="BaseResultMap"> |
| | | select awd.* |
| | | from asr_wrk_detl awd |
| | | left join asr_wrk_mast awm on awd.wrk_no = awm.wrk_no and awd.io_time = awm.io_time |
| | | where order_no = #{orderNo} |
| | | where order_no = #{orderNo} and awm.io_type != 103 |
| | | union |
| | | select distinct awdl.* |
| | | from asr_wrk_detl_log awdl |
| | | left join asr_wrk_mast_log awml on awdl.wrk_no = awml.wrk_no and awdl.io_time = awml.io_time |
| | | where awdl.order_no = #{orderNo} |
| | | where awdl.order_no = #{orderNo} and awml.io_type != 103 |
| | | and (awml.manu_type is null or awml.manu_type != '手动取消') |
| | | </select> |
| | | |
| | |
| | | ,{field: 'matnr', align: 'center',title: '商品编码', width: 160} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', width: 200} |
| | | ,{field: 'batch', align: 'center',title: '批次'} |
| | | ,{field: 'sku', align: 'center',title: 'U8旧品名'} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'anfme', align: 'center',title: '主数量'} |
| | | ,{field: 'weight', align: 'center',title: '辅数量'} |
| | | // ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: false} |
| | | ,{field: 'manu', align: 'center',title: '辅单位'} |
| | | // ,{field: 'qty', align: 'center',title: '作业数量', style: 'font-weight: bold'} |
| | | ,{field: 'enableQty', align: 'center',title: '待出数量', style: 'font-weight: bold'} |
| | | // ,{field: 'name', align: 'center',title: '名称'} |
| | | // ,{field: 'model', align: 'center',title: '型号'} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | | ,{field: 'barcode', align: 'center',title: '商品条码', hide: true} |
| | | // ,{field: 'supplier', align: 'center',title: '供应商'} |
| | | // ,{field: 'unitPrice', align: 'center',title: '单价'} |
| | |
| | | // {type: 'checkbox', merge: ['orderNo']}, |
| | | {field: 'orderNo', title: '单据编号', merge: true, align: 'center'}, |
| | | {field: 'title', title: '商品', merge: true, align: 'center', width: 350}, |
| | | {field: 'batch', title: '序列码', align: 'center'}, |
| | | {field: 'anfme', title: '数量', align: 'center', width: 90, style: 'font-weight: bold'}, |
| | | {field: 'batch', title: '批次', align: 'center'}, |
| | | {field: 'anfme', title: '主数量', align: 'center', width: 90, style: 'font-weight: bold'}, |
| | | {field: 'weight', title: '辅数量', align: 'center', width: 90, style: 'font-weight: bold'}, |
| | | {field: 'unit', align: 'center',title: '单位'}, |
| | | {field: 'locNo', title: '货位', align: 'center', width: 100, templet: '#locNoTpl'}, |
| | | {field: 'frozen$', title: '明细', align: 'center', width: 90, templet: '#locFrozen'}, |
| | | {field: 'frozenLoc$', title: '库位', align: 'center', width: 90, templet: '#locFrozenLoc'}, |