| | |
| | | if (issued <= 0.0D) { |
| | | continue; |
| | | } |
| | | List<LocDetl> locDetls = locDetlService.queryStock(orderDetl); |
| | | |
| | | // 使用新增多字段条件查询库存(可改成传入参数来优化) |
| | | List<LocDetl> locDetls = locDetlService.queryStock(orderDetl); // 这个方法内部应该根据多个字段匹配 |
| | | |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (locDetl.getMatnr().equals(orderDetl.getMatnr())) { |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(), |
| | | issued >= locDetl.getAnfme() ? locDetl.getAnfme() : issued); |
| | | List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locDetl.getLocNo(), issued >= locDetl.getAnfme() ? 101 : 103); |
| | | locDto.setStaNos(staNos); |
| | | locDto.setModel(locDetl.getModel()); |
| | | locDto.setOutOrderNo(locDetl.getOutOrderNo()); |
| | | locDto.setLuHao(locDetl.getLuHao()); |
| | | locDto.setPacking(locDetl.getPacking()); |
| | | locDto.setProType(locDetl.getProType()); |
| | | locDto.setSPgNO(locDetl.getSPgNO()); |
| | | locDto.setColor(locDetl.getColor()); |
| | | locDtos.add(locDto); |
| | | //exist.add(locDetl.getLocNo()); |
| | | // 剩余待出数量递减 |
| | | issued = issued - locDetl.getAnfme(); |
| | | } else { |
| | | break; |
| | | } |
| | | // 多字段匹配 |
| | | boolean match = locDetl.getMatnr().equals(orderDetl.getMatnr()) |
| | | && Objects.equals(locDetl.getOutOrderNo(), orderDetl.getOutOrderNo()) |
| | | && Objects.equals(locDetl.getTemp2(), orderDetl.getTemp2()) |
| | | && Objects.equals(locDetl.getProType(), orderDetl.getProType()) |
| | | && Objects.equals(locDetl.getModel(), orderDetl.getModel()) |
| | | && Objects.equals(locDetl.getLuHao(), orderDetl.getLuHao()); |
| | | |
| | | if (!match) continue; |
| | | |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), |
| | | locDetl.getBatch(), orderDetl.getOrderNo(), |
| | | issued >= locDetl.getAnfme() ? locDetl.getAnfme() : issued); |
| | | List<Integer> staNos = staDescService.queryOutStaNosByLocNo(locDetl.getLocNo(), issued >= locDetl.getAnfme() ? 101 : 103); |
| | | locDto.setStaNos(staNos); |
| | | locDto.setModel(locDetl.getModel()); |
| | | locDto.setOutOrderNo(locDetl.getOutOrderNo()); |
| | | locDto.setLuHao(locDetl.getLuHao()); |
| | | locDto.setPacking(locDetl.getPacking()); |
| | | locDto.setProType(locDetl.getProType()); |
| | | locDto.setSPgNO(locDetl.getSPgNO()); |
| | | locDto.setColor(locDetl.getColor()); |
| | | locDto.setTemp2(locDetl.getTemp2()); // 新增字段 |
| | | locDtos.add(locDto); |
| | | |
| | | issued = issued - locDetl.getAnfme(); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(null, orderDetl.getMatnr(), orderDetl.getMaktx(), orderDetl.getBatch(), orderDetl.getOrderNo(), issued); |
| | | locDto.setLack(Boolean.TRUE); |
| | |
| | | locDto.setProType(orderDetl.getProType()); |
| | | locDto.setSPgNO(orderDetl.getSPgNO()); |
| | | locDto.setColor(orderDetl.getColor()); |
| | | locDto.setTemp2(orderDetl.getTemp2()); |
| | | locDtos.add(locDto); |
| | | } |
| | | } |
| | | |
| | | return R.ok().add(locDtos); |
| | | } |
| | | |
| | |
| | | |
| | | // ------------------------------------------------- |
| | | |
| | | List<LocDetl> queryStock(@Param("sPgNO")String sPgNO, @Param("matnr")String matnr, @Param("batch")String batch, @Param("orderNo")String orderNo, @Param("locNos") Set<String> locNos); |
| | | List<LocDetl> queryStock(@Param("sPgNO") String sPgNO, |
| | | @Param("matnr") String matnr, |
| | | @Param("batch") String batch, |
| | | @Param("outOrderNo") String outOrderNo, |
| | | @Param("temp2") String temp2, |
| | | @Param("proType") String proType, |
| | | @Param("model") String model, |
| | | @Param("luHao") String luHao, |
| | | @Param("locNos") Set<String> locNos); |
| | | |
| | | Double queryStockAnfme(String matnr, String batch); |
| | | |
| | |
| | | @Override |
| | | public List<LocDetl> queryStock(OrderDetl orderDetl) { |
| | | List<LocDetl> data = new ArrayList<>(); |
| | | List<LocDetl> locDetls = this.baseMapper.queryStock(null, orderDetl.getMatnr(), null, null, null); |
| | | List<LocDetl> locDetls = this.baseMapper.queryStock( |
| | | null, |
| | | orderDetl.getMatnr(), |
| | | orderDetl.getBatch(), |
| | | orderDetl.getOutOrderNo(), |
| | | orderDetl.getTemp2(), |
| | | orderDetl.getProType(), |
| | | orderDetl.getModel(), |
| | | null, |
| | | null // locNos 如果有排除列表也可以传 |
| | | ); |
| | | if (locDetls == null) { |
| | | return null; |
| | | } |
| | |
| | | |
| | | private String color; |
| | | |
| | | private String temp2; |
| | | |
| | | public LocDto() { |
| | | } |
| | | |
| | |
| | | this.anfme = anfme; |
| | | } |
| | | |
| | | public LocDto(String locNo, String matnr, String maktx, String batch, String orderNo,String temp2, Double anfme) { |
| | | this.locNo = locNo; |
| | | this.matnr = matnr; |
| | | this.maktx = maktx; |
| | | this.batch = batch; |
| | | this.orderNo = orderNo; |
| | | this.temp2 = temp2; |
| | | this.anfme = anfme; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return this.matnr + "(" + this.maktx + ")"; |
| | | } |
| | |
| | | times++; |
| | | } |
| | | } |
| | | // if (nearRow == 0) { |
| | | // throw new CoolException("无可用堆垛机"); |
| | | // } |
| | | if (nearRow == 0) { |
| | | throw new CoolException("无可用堆垛机"); |
| | | } |
| | | |
| | | boolean signRule1 = false; |
| | | boolean signRule2 = false; |
| | |
| | | if (Cools.isEmpty(param.getBarcode())) { |
| | | return R.error("条码不能为空"); |
| | | } |
| | | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", param.getBarcode())); |
| | | if (countWrk > 0) { |
| | | return R.error("工作档已存在"); |
| | | } |
| | | waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarcode())); |
| | | if (Cools.isEmpty(waitPakins)) { |
| | | WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarcode()); |
| | |
| | | int countLoc = locDetlService.selectCount(new EntityWrapper<LocDetl>().eq("zpallet", param.getBarcode())); |
| | | if (countLoc > 0) { |
| | | return R.error("库存条码数据已存在"); |
| | | } |
| | | int countWrk = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>().eq("zpallet", param.getBarcode())); |
| | | if (countWrk > 0) { |
| | | return R.error("工作档已存在"); |
| | | } |
| | | } |
| | | if (Cools.isEmpty(param.getLocType1())) { |
| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | int insert = erpSqlServer.insert(OutDetTB.class, content); |
| | | |
| | | if (insert == 1) { |
| | | log.info("入库单表身回传成功:" + content.toString()); |
| | | log.info("出库单表身回传成功:" + content.toString()); |
| | | return true; |
| | | } else { |
| | | log.error("入库回传失败,实体类打印:" + content.toString()); |
| | | log.error("出库回传失败,实体类打印:" + content.toString()); |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Transactional(rollbackFor = Throwable.class) |
| | | public boolean insertOutHed(Order order) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | String sqlInHedTb = "select * from lk_OutHedTB where LKName='高霖立库' and BillNo='" + order.getOrderNo() + "'"; |
| | | List<OutHedTB> outHeds = erpSqlServer.select(sqlInHedTb, OutHedTB.class); |
| | | String sqlInHedTbBak = "select * from lk_OutHedTB_Bak where LKName='高霖立库' and BillNo='" + order.getOrderNo() + "'"; |
| | |
| | | if (!Cools.isEmpty(docType.getDocName())) content.put("IoKindName", "'" + docType.getDocName() + "'"); |
| | | if (!Cools.isEmpty(order.getWareId())) content.put("WareId", "'" + order.getWareId() + "'"); |
| | | if (!Cools.isEmpty(order.getWareName())) content.put("WareName", "'" + order.getWareName() + "'"); |
| | | if (!Cools.isEmpty(order.getUpdateTime())) content.put("MakeDate", "'" + order.getUpdateTime() + "'"); |
| | | if (!Cools.isEmpty(order.getUpdateTime())) content.put("MakeDate", "'" + sdf.format(order.getUpdateTime()) + "'"); |
| | | if (!Cools.isEmpty(order.getTemp1())) content.put("Temp1", "'" + order.getTemp1() + "'"); |
| | | if (!Cools.isEmpty(order.getTemp2())) content.put("Temp2", "'" + order.getTemp2() + "'"); |
| | | if (!Cools.isEmpty(order.getTemp3())) content.put("Temp3", "'" + order.getTemp3() + "'"); |
| | |
| | | if (!Cools.isEmpty(order.getMemo())) content.put("Remark", "'" + order.getMemo() + "'"); |
| | | content.put("LKName", "'高霖立库'"); |
| | | content.put("bPass", "1"); |
| | | System.out.println("插入内容:" + content); |
| | | int insert = erpSqlServer.insert(OutHedTB.class, content); |
| | | if (insert == 1) { |
| | | log.info("入库单表头回传成功:" + content); |
| | |
| | | <if test="batch != null and batch != ''"> |
| | | and a.batch = #{batch} |
| | | </if> |
| | | <if test="outOrderNo != null and outOrderNo != ''"> |
| | | and a.out_order_no = #{outOrderNo} |
| | | </if> |
| | | <if test="temp2 != null and temp2 != ''"> |
| | | and a.temp2 = #{temp2} |
| | | </if> |
| | | <if test="proType != null and proType != ''"> |
| | | and a.pro_type = #{proType} |
| | | </if> |
| | | <if test="model != null and model != ''"> |
| | | and a.model = #{model} |
| | | </if> |
| | | <if test="luHao != null and luHao != ''"> |
| | | and a.lu_hao = #{luHao} |
| | | </if> |
| | | |
| | | <!-- <choose>--> |
| | | <!-- <when test="batch != null and batch != ''">--> |
| | | <!-- and batch = #{batch}--> |
| | |
| | | {field: 'zpallet', align: 'center',title: '托盘码'}, |
| | | {field: 'locNo', title: '货位', align: 'center', width: 100, templet: '#locNoTpl'}, |
| | | {field: 'staNos', align: 'center', title: '出库站', merge: ['locNo'], templet: '#tbBasicTbStaNos'}, |
| | | {field: 'outOrderNo', hide: false}, |
| | | {field: 'outOrderNo', title: '合同号', align: 'center',hide: false}, |
| | | {field: 'temp2', align: 'center',title: '客户图号', hide: false}, |
| | | |
| | | {field: 'luHao', hide: true}, |
| | | {field: 'packing', hide: true}, |
| | | {field: 'proType', hide: false}, |
| | | {field: 'proType', align: 'center',title: '属性',hide: false}, |
| | | {type: 'checkbox', merge: ['locNo']}, |
| | | ]], |
| | | done: function (res) { |