| | |
| | | private Date ioTime; |
| | | |
| | | /** |
| | | * 数量 |
| | | * 作业数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | @ApiModelProperty(value= "作业数量") |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 总库存 |
| | | */ |
| | | @ApiModelProperty(value= "总库存") |
| | | private Double stock; |
| | | |
| | | /** |
| | | * 托盘条码 |
| | | */ |
| | | @ApiModelProperty(value= "托盘条码") |
| | |
| | | private Date ioTime; |
| | | |
| | | /** |
| | | * 数量 |
| | | * 作业数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | @ApiModelProperty(value= "作业数量") |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 总库存 |
| | | */ |
| | | @ApiModelProperty(value= "总库存") |
| | | private Double stock; |
| | | |
| | | /** |
| | | * 托盘条码 |
| | | */ |
| | | @ApiModelProperty(value= "托盘条码") |
| | |
| | | } |
| | | } |
| | | |
| | | for (OutLocDto dto : dtos) { |
| | | dto.sortLocDetlDtos(); |
| | | } |
| | | |
| | | |
| | | ArrayList<String> outerLocs = new ArrayList<>(); |
| | | //检测是否为浅库位 |
| | | boolean sign=false; |
| | |
| | | } |
| | | // 生成工作档明细 |
| | | for (LocDetlDto detlDto : dto.getLocDetlDtos()) { |
| | | if (detlDto.getCount()==null || detlDto.getCount() <= 0.0D) {continue;} |
| | | if (detlDto.getCount()==null) {continue;} |
| | | WrkDetl wrkDetl = new WrkDetl(); |
| | | wrkDetl.sync(detlDto.getLocDetl()); |
| | | wrkDetl.setOrderNo(""); // 手动出库不需要带出库存中的单据编号 |
| | | wrkDetl.setWrkNo(workNo); |
| | | wrkDetl.setIoTime(now); |
| | | Double anfme = ioType==101?detlDto.getLocDetl().getAnfme():detlDto.getCount(); |
| | | wrkDetl.setAnfme(anfme); // 数量 |
| | | wrkDetl.setAnfme(anfme); // 作业数量 |
| | | wrkDetl.setStock(detlDto.getLocDetl().getAnfme()); |
| | | wrkDetl.setAppeTime(now); |
| | | wrkDetl.setAppeUser(userId); |
| | | wrkDetl.setModiTime(now); |
| | |
| | | } |
| | | log.info("工作号:" + wrkMast.getWrkNo() + ",托盘码:" + wrkMast.getBarcode() + ",工作档明细列表:" + JSON.toJSONString(wrkDetls53)); |
| | | for (WrkDetl wrkDetl : wrkDetls53) { |
| | | |
| | | LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(),wrkDetl.getSuppCode()); |
| | | if (null != locDetl) { |
| | | log.info("工作号:" + wrkMast.getWrkNo() + ",托盘码:" + wrkMast.getBarcode() + ",工作档明细:" + JSON.toJSONString(wrkDetl) + ",库存明细:" + JSON.toJSONString(locDetl)); |
| | | if (!locDetlService.updateAnfme(locDetl.getAnfme() - wrkDetl.getAnfme(), |
| | | locMast.getLocNo(), |
| | | wrkDetl.getMatnr(), |
| | | wrkDetl.getBatch(), |
| | | wrkDetl.getSuppCode(), |
| | | wrkDetl.getThreeCode(), |
| | | wrkDetl.getDeadTime())) { |
| | | exceptionHandle("拣料入库 ===>> 修改库存明细数量失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | } |
| | | double anfme = wrkDetl.getStock() - wrkDetl.getAnfme(); |
| | | if (anfme <= 0) {//库存 - 作业数量 <= 0 清掉该数据 |
| | | continue; |
| | | } |
| | | |
| | | LocDetl locDetl = new LocDetl(); |
| | | locDetl.sync(wrkDetl); |
| | | locDetl.setLocNo(wrkMast.getLocNo()); |
| | | locDetl.setAnfme(anfme); |
| | | locDetl.setZpallet(wrkDetl.getZpallet()); // 托盘条码 |
| | | locDetl.setAppeTime(now); |
| | | locDetl.setAppeUser(9527L); |
| | | locDetl.setModiTime(now); |
| | | locDetl.setModiUser(9527L); |
| | | if (!locDetlService.insert(locDetl)) { |
| | | exceptionHandle("拣料入库 ===>> 修改库存明细数量失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | } |
| | | |
| | | // LocDetl locDetl = locDetlService.selectItem(locMast.getLocNo(), wrkDetl.getMatnr(), wrkDetl.getBatch(),wrkDetl.getSuppCode()); |
| | | // if (null != locDetl) { |
| | | // log.info("工作号:" + wrkMast.getWrkNo() + ",托盘码:" + wrkMast.getBarcode() + ",工作档明细:" + JSON.toJSONString(wrkDetl) + ",库存明细:" + JSON.toJSONString(locDetl)); |
| | | // if (!locDetlService.updateAnfme(locDetl.getAnfme() - wrkDetl.getAnfme(), |
| | | // locMast.getLocNo(), |
| | | // wrkDetl.getMatnr(), |
| | | // wrkDetl.getBatch(), |
| | | // wrkDetl.getSuppCode(), |
| | | // wrkDetl.getThreeCode(), |
| | | // wrkDetl.getDeadTime())) { |
| | | // exceptionHandle("拣料入库 ===>> 修改库存明细数量失败;[workNo={0}],[locNo={1}]", wrkMast.getWrkNo(), wrkMast.getLocNo()); |
| | | // } |
| | | // } |
| | | } |
| | | // 修改库位状态 Q ====>> F |
| | | if (locMast.getLocSts().equals("Q")) { |
| | |
| | | if (!locMastService.updateById(sourceLoc)) { |
| | | exceptionHandle("库位移转 ===>> 修改源库位状态失败;[workNo={0}],[sourceLoc={1}]", wrkMast.getWrkNo(), wrkMast.getSourceLocNo()); |
| | | } |
| | | locDetlService.delete(new EntityWrapper<LocDetl>().eq("loc_no",locMast.getLocNo())); |
| | | } |
| | | // 修改目标库位状态 ==> .locSts |
| | | locMast.setLocSts(locSts); |
| | |
| | | return sameNumber == locDetls.size(); |
| | | } |
| | | |
| | | public void sortLocDetlDtos() { |
| | | ArrayList<LocDetlDto> list = new ArrayList<>(); |
| | | EntityWrapper<LocDetl> wrapper = new EntityWrapper<>(); |
| | | wrapper.eq("loc_no", locNo); |
| | | LocDetlService locDetlService = SpringUtils.getBean(LocDetlService.class); |
| | | List<LocDetl> locDetls = locDetlService.selectList(wrapper); |
| | | for (LocDetl locDetl : locDetls) { |
| | | boolean flag = true; |
| | | for (LocDetlDto locDetlDto : locDetlDtos) { |
| | | LocDetl detl = locDetlDto.getLocDetl(); |
| | | if (!Cools.isEmpty(locDetl.getMatnr())) { |
| | | if (!locDetl.getMatnr().equals(detl.getMatnr())) { |
| | | continue; |
| | | } |
| | | } |
| | | if (!Cools.isEmpty(locDetl.getBatch())) { |
| | | if (!locDetl.getBatch().equals(detl.getBatch())) { |
| | | continue; |
| | | } |
| | | } |
| | | if (!Cools.isEmpty(locDetl.getSuppCode())) { |
| | | if (!locDetl.getSuppCode().equals(detl.getSuppCode())) { |
| | | continue; |
| | | } |
| | | } |
| | | flag = false; |
| | | break; |
| | | } |
| | | |
| | | if (flag) { |
| | | LocDetlDto dto = new LocDetlDto(locDetl, 0D); |
| | | list.add(dto); |
| | | } |
| | | } |
| | | |
| | | locDetlDtos.addAll(list); |
| | | // ArrayList<String> matnr = new ArrayList<>(); |
| | | // ArrayList<String> batch = new ArrayList<>(); |
| | | // ArrayList<String> suppCode = new ArrayList<>(); |
| | | // for (LocDetlDto locDetlDto : locDetlDtos) { |
| | | // LocDetl locDetl = locDetlDto.getLocDetl(); |
| | | // if (!Cools.isEmpty(locDetl.getMatnr())) { |
| | | // matnr.add(locDetl.getMatnr()); |
| | | // } |
| | | // if (!Cools.isEmpty(locDetl.getBatch())) { |
| | | // batch.add(locDetl.getBatch()); |
| | | // } |
| | | // if (!Cools.isEmpty(locDetl.getSuppCode())) { |
| | | // suppCode.add(locDetl.getSuppCode()); |
| | | // } |
| | | // } |
| | | // |
| | | // EntityWrapper<LocDetl> wrapper = new EntityWrapper<>(); |
| | | // wrapper.eq("loc_no", locNo); |
| | | // wrapper.notIn("matnr", matnr); |
| | | // wrapper.notIn("batch", batch); |
| | | // wrapper.notIn("supp_code", suppCode); |
| | | // LocDetlService locDetlService = SpringUtils.getBean(LocDetlService.class); |
| | | // List<LocDetl> locDetls = locDetlService.selectList(wrapper); |
| | | // for (LocDetl locDetl : locDetls) { |
| | | // LocDetlDto dto = new LocDetlDto(locDetl, 0D); |
| | | // locDetlDtos.add(dto); |
| | | // } |
| | | } |
| | | |
| | | } |
| | |
| | | throw new CoolException(dto.getLocNo() + "目标库位已被占用"); |
| | | } |
| | | |
| | | Date now = new Date(); |
| | | for (LocDetl locDetl : locDetls) { |
| | | locDetl.setLocNo(dto.getLocNo());//修改目标库位 |
| | | locDetl.setAppeTime(now); |
| | | locDetl.setModiTime(now); |
| | | if (!locDetlService.insert(locDetl)) { |
| | | throw new CoolException("库存明细更新失败"); |
| | | } |
| | | } |
| | | // Date now = new Date(); |
| | | // for (LocDetl locDetl : locDetls) { |
| | | // locDetl.setLocNo(dto.getLocNo());//修改目标库位 |
| | | // locDetl.setAppeTime(now); |
| | | // locDetl.setModiTime(now); |
| | | // if (!locDetlService.insert(locDetl)) { |
| | | // throw new CoolException("库存明细更新失败"); |
| | | // } |
| | | // } |
| | | |
| | | //检查目标库位,库存明细是否添加成功 |
| | | List<LocDetl> checkLocDetls = locDetlService.selectByLocNo(dto.getLocNo()); |
| | | if (checkLocDetls.isEmpty()) { |
| | | throw new CoolException("库存明细迁移失败"); |
| | | } |
| | | // //检查目标库位,库存明细是否添加成功 |
| | | // List<LocDetl> checkLocDetls = locDetlService.selectByLocNo(dto.getLocNo()); |
| | | // if (checkLocDetls.isEmpty()) { |
| | | // throw new CoolException("库存明细迁移失败"); |
| | | // } |
| | | |
| | | // //清空源库位数据 |
| | | LocMast locMast1 = locMastService.selectByLoc(wrkMast.getSourceLocNo()); |
| | |
| | | <result column="wrk_no" property="wrkNo" /> |
| | | <result column="io_time" property="ioTime" /> |
| | | <result column="anfme" property="anfme" /> |
| | | <result column="stock" property="stock" /> |
| | | <result column="zpallet" property="zpallet" /> |
| | | <result column="matnr" property="matnr" /> |
| | | <result column="maktx" property="maktx" /> |
| | |
| | | <result column="wrk_no" property="wrkNo" /> |
| | | <result column="io_time" property="ioTime" /> |
| | | <result column="anfme" property="anfme" /> |
| | | <result column="stock" property="stock" /> |
| | | <result column="zpallet" property="zpallet" /> |
| | | <result column="matnr" property="matnr" /> |
| | | <result column="maktx" property="maktx" /> |
| | |
| | | ,{field: 'matnr', align: 'center',title: '存货编码',hide: true} |
| | | ,{field: 'suppCode', align: 'center',title: '料箱码', hide: false} |
| | | ,{field: 'matnr', align: 'center',title: '存货编码'} |
| | | ,{field: 'anfme', align: 'center',title: '数量'} |
| | | ,{field: 'anfme', align: 'center',title: '作业数量'} |
| | | ,{field: 'stock', align: 'center',title: '总库存'} |
| | | ,{field: 'batch', align: 'center',title: '序列码', width: 300, sort:true, hide: true} |
| | | ,{field: 'maktx', align: 'center',title: '存货名称'} |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', hide: false} |