| | |
| | | // 获取订单主表 |
| | | OrderPakout orderPakOut = orderPakOutService.selectByNo(orderDetlPakouts.get(0).getOrderNo()); |
| | | // 盘点单出库 |
| | | if (orderPakOut.getDocType() == 8) { |
| | | if (orderPakOut.getDocType() == 20) { |
| | | for (OrderDetlPakout orderDetl : orderDetlPakouts) { |
| | | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getWorkQty()).orElse(0.0D); |
| | | if (issued <= 0.0D) { |
| | |
| | | locDtos.add(locDto); |
| | | } |
| | | } |
| | | } else { |
| | | } else if(orderPakOut.getDocType() == 10 || orderPakOut.getDocType() == 14) { |
| | | for (OrderDetlPakout orderDetl : orderDetlPakouts) { |
| | | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getWorkQty()).orElse(0.0D); |
| | | if (issued <= 0.0D) { |
| | | continue; |
| | | } |
| | | // List<LocDetl> locDetls = locDetlService.queryStockAll(null, exist,orderDetl.getMatnr(), orderDetl.getBatch(), |
| | | // orderDetl.getBrand(),orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3()); |
| | | List<LocDetl> locDetls = locDetlService.queryStockMatnr(orderDetl.getMatnr()); |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(), |
| | | issued >= locDetl.getAnfme() ? locDetl.getAnfme() : issued); |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetl.getLocNo())); |
| | | locDto.setFrozen(locDetl.getFrozen()); |
| | | locDto.setFrozenLoc(locMast.getFrozen()); |
| | | List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locDetl.getLocNo(), issued >= locDetl.getAnfme() ? 101 : 103); |
| | | locDto.setStaNos(staNos); |
| | | locDto.setBrand(orderDetl.getBrand()); |
| | | |
| | | locDto.setStandby1(orderDetl.getStandby1()); |
| | | locDto.setStandby2(orderDetl.getStandby2()); |
| | | locDto.setStandby3(orderDetl.getStandby3()); |
| | | locDto.setBoxType1(orderDetl.getBoxType1()); |
| | | locDto.setBoxType2(orderDetl.getBoxType2()); |
| | | locDto.setBoxType3(orderDetl.getBoxType3()); |
| | | locDtos.add(locDto); |
| | | exist.add(locDetl.getLocNo()); |
| | | // 剩余待出数量递减 |
| | | issued = issued - locDetl.getAnfme(); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), issued); |
| | | locDto.setBrand(orderDetl.getBrand()); |
| | | locDto.setStandby1(orderDetl.getStandby1()); |
| | | locDto.setStandby2(orderDetl.getStandby2()); |
| | | locDto.setStandby3(orderDetl.getStandby3()); |
| | | locDto.setBoxType1(orderDetl.getBoxType1()); |
| | | locDto.setBoxType2(orderDetl.getBoxType2()); |
| | | locDto.setBoxType3(orderDetl.getBoxType3()); |
| | | locDto.setLack(Boolean.TRUE); |
| | | locDtos.add(locDto); |
| | | } |
| | | } |
| | | }else { |
| | | for (OrderDetlPakout orderDetl : orderDetlPakouts) { |
| | | double issued = Optional.of(orderDetl.getAnfme() - orderDetl.getWorkQty()).orElse(0.0D); |
| | | if (issued <= 0.0D) { |
| | |
| | | @Param("standby3")String standby3,@Param("boxType1")String boxType1,@Param("boxType2")String boxType2); |
| | | |
| | | Double queryStockAnfme(String matnr, String batch); |
| | | List<LocDetl> queryStockMatnr(@Param("matnr")String matnr); |
| | | |
| | | List<StockVo> queryStockTotal(); |
| | | |
| | |
| | | // -------------------------------------------------- |
| | | |
| | | List<LocDetl> queryStock(String matnr, String batch, String orderNo, Set<String> locNos); |
| | | List<LocDetl> queryStockMatnr(String matnr); |
| | | |
| | | // List<LocDetl> queryStockAll(String orderNo, Set<String> locNos,String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3); |
| | | List<LocDetl> queryStockAll(String orderNo, Set<String> locNos,String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2); |
| | |
| | | return this.baseMapper.queryStock(matnr, batch, orderNo, locNos); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<LocDetl> queryStockMatnr(String matnr) { |
| | | return this.baseMapper.queryStockMatnr(matnr); |
| | | } |
| | | |
| | | // @Override |
| | | // public List<LocDetl> queryStockAll(String orderNo, Set<String> locNos,String matnr, String batch, String brand, String standby1, String standby2, String standby3, String boxType1, String boxType2, String boxType3) { |
| | |
| | | end |
| | | desc |
| | | </select> |
| | | |
| | | <select id="queryStockMatnr" resultMap="BaseResultMap"> |
| | | select a.* |
| | | from asr_loc_detl a |
| | | left join asr_loc_mast b on a.loc_no = b.loc_no |
| | | where 1=1 |
| | | and b.loc_sts = 'F' |
| | | and a.matnr = #{matnr} |
| | | order by |
| | | DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time), a.anfme |
| | | desc, |
| | | NEWID(), |
| | | case |
| | | when (left(a.loc_no, 2) = '01') then 0 |
| | | when (left(a.loc_no, 2) = '02') then 1 |
| | | when (left(a.loc_no, 2) = '03') then 1 |
| | | when (left(a.loc_no, 2) = '04') then 0 |
| | | when (left(a.loc_no, 2) = '05') then 0 |
| | | when (left(a.loc_no, 2) = '06') then 1 |
| | | when (left(a.loc_no, 2) = '07') then 1 |
| | | when (left(a.loc_no, 2) = '08') then 0 |
| | | when (left(a.loc_no, 2) = '09') then 0 |
| | | when (left(a.loc_no, 2) = '10') then 1 |
| | | when (left(a.loc_no, 2) = '11') then 1 |
| | | when (left(a.loc_no, 2) = '12') then 0 |
| | | when (left(a.loc_no, 2) = '13') then 0 |
| | | when (left(a.loc_no, 2) = '14') then 1 |
| | | when (left(a.loc_no, 2) = '15') then 1 |
| | | when (left(a.loc_no, 2) = '16') then 0 |
| | | when (left(a.loc_no, 2) = '17') then 0 |
| | | when (left(a.loc_no, 2) = '18') then 1 |
| | | when (left(a.loc_no, 2) = '19') then 1 |
| | | when (left(a.loc_no, 2) = '20') then 0 |
| | | when (left(a.loc_no, 2) = '21') then 0 |
| | | when (left(a.loc_no, 2) = '22') then 1 |
| | | when (left(a.loc_no, 2) = '23') then 1 |
| | | when (left(a.loc_no, 2) = '24') then 0 |
| | | when (left(a.loc_no, 2) = '25') then 0 |
| | | when (left(a.loc_no, 2) = '26') then 1 |
| | | when (left(a.loc_no, 2) = '27') then 1 |
| | | when (left(a.loc_no, 2) = '28') then 0 |
| | | when (left(a.loc_no, 2) = '29') then 0 |
| | | when (left(a.loc_no, 2) = '30') then 1 |
| | | when (left(a.loc_no, 2) = '31') then 1 |
| | | when (left(a.loc_no, 2) = '32') then 0 |
| | | when (left(a.loc_no, 2) = '33') then 0 |
| | | when (left(a.loc_no, 2) = '34') then 1 |
| | | when (left(a.loc_no, 2) = '35') then 1 |
| | | when (left(a.loc_no, 2) = '36') then 0 |
| | | when (left(a.loc_no, 2) = '37') then 0 |
| | | when (left(a.loc_no, 2) = '38') then 1 |
| | | when (left(a.loc_no, 2) = '39') then 1 |
| | | when (left(a.loc_no, 2) = '40') then 0 |
| | | when (left(a.loc_no, 2) = '41') then 0 |
| | | when (left(a.loc_no, 2) = '42') then 1 |
| | | when (left(a.loc_no, 2) = '43') then 1 |
| | | when (left(a.loc_no, 2) = '44') then 0 |
| | | when (left(a.loc_no, 2) = '45') then 0 |
| | | when (left(a.loc_no, 2) = '46') then 1 |
| | | when (left(a.loc_no, 2) = '47') then 1 |
| | | when (left(a.loc_no, 2) = '48') then 0 |
| | | else 0 |
| | | end |
| | | desc |
| | | </select> |
| | | <select id="queryStockAll" resultMap="BaseResultMap"> |
| | | select a.* |
| | | from asr_loc_detl a |
| | |
| | | ,{field: 'orderNo', align: 'center',title: '单据编号', templet: '#orderNoTpl', width: 160} |
| | | ,{field: 'matnr', align: 'center',title: '商品编号', width: 160} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称', width: 200} |
| | | ,{field: 'batch', align: 'center',title: '序列码',hide:true} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | // ,{field: 'batch', align: 'center',title: '序列码',hide:true} |
| | | // ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'standby1', align: 'center',title: 'po', hide: false} |
| | | ,{field: 'standby2', align: 'center',title: 'upc', hide: false} |
| | | // ,{field: 'anfme', align: 'center',title: '数量'} |
| | |
| | | cols: [[ |
| | | // {type: 'checkbox', merge: ['orderNo']}, |
| | | {field: 'orderNo', title: '单据编号', merge: true, align: 'center'}, |
| | | {field: 'title', title: '商品', merge: true, align: 'center', width: 350}, |
| | | {field: 'matnr', title: '物料编码', merge: true, align: 'center', width: 350}, |
| | | {field: 'batch', title: '序列码', align: 'center',hide:true}, |
| | | {field: 'anfme', title: '数量', align: 'center', width: 90, style: 'font-weight: bold'}, |
| | | {field: 'locNo', title: '货位', align: 'center', width: 100, templet: '#locNoTpl'}, |