| | |
| | | DateUtils.convert(now), // 单据日期 |
| | | param.getDocType(), // 单据类型 |
| | | null, // 项目编号 |
| | | param.getStandby1(), //项目名称 客户PO号 |
| | | null, //项目名称 客户PO号 |
| | | null, // 调拨项目编号 |
| | | null, // 初始票据号 |
| | | null, // 票据号 |
| | | null, // 客户编号 |
| | | locOwner.getOwner(), // 客户 |
| | | null, // 客户 |
| | | null, // 联系方式 |
| | | null, // 操作人员 |
| | | null, // 合计金额 |
| | |
| | | orderDetl.setUpdateTime(now); |
| | | orderDetl.setStatus(1); |
| | | orderDetl.setQty(0.0D); |
| | | orderDetl.setStandby1(param.getStandby1().toString());//po |
| | | orderDetl.setBoxType1(locOwner.getId().toString());//货主ID |
| | | orderDetl.setBoxType2(locOwner.getOwnerUuid().toString());//货主UUID |
| | | orderDetl.setBoxType3(locOwner.getOwner());//货主 |
| | | // orderDetl.setStandby1(param.getStandby1().toString());//po |
| | | // orderDetl.setBoxType1(locOwner.getId().toString());//货主ID |
| | | // orderDetl.setBoxType2(locOwner.getOwnerUuid().toString());//货主UUID |
| | | // orderDetl.setBoxType3(locOwner.getOwner());//货主 |
| | | orderDetl.setPakinPakoutStatus(status); |
| | | if (!orderDetlService.insert(orderDetl)) { |
| | | throw new CoolException("保存订单明细档失败"); |
| | |
| | | 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.queryStockAll(null, exist,orderDetl.getMatnr(), orderDetl.getBatch(), |
| | | orderDetl.getBrand(),orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3()); |
| | | orderDetl.getBrand(),orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getBoxType1(),orderDetl.getBoxType2()); |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(), |
| | |
| | | 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.queryStockAll(null, exist,orderDetl.getMatnr(), orderDetl.getBatch(), |
| | | orderDetl.getBrand(),orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getBoxType1(),orderDetl.getBoxType2(),orderDetl.getBoxType3()); |
| | | orderDetl.getBrand(),orderDetl.getStandby1(),orderDetl.getStandby2(),orderDetl.getStandby3(),orderDetl.getBoxType1(),orderDetl.getBoxType2()); |
| | | for (LocDetl locDetl : locDetls) { |
| | | if (issued > 0) { |
| | | LocDto locDto = new LocDto(locDetl.getLocNo(), locDetl.getMatnr(), locDetl.getMaktx(), locDetl.getBatch(), orderDetl.getOrderNo(), |
| | |
| | | // ------------------------------------------------- |
| | | |
| | | List<LocDetl> queryStock(@Param("matnr")String matnr, @Param("batch")String batch, @Param("orderNo")String orderNo, @Param("locNos") Set<String> locNos); |
| | | // List<LocDetl> queryStockAll(@Param("orderNo")String orderNo, @Param("locNos") Set<String> locNos, @Param("matnr")String matnr, @Param("batch")String batch, |
| | | // @Param("brand")String brand,@Param("standby1")String standby1,@Param("standby2")String standby2, |
| | | // @Param("standby3")String standby3,@Param("boxType1")String boxType1,@Param("boxType2")String boxType2,@Param("boxType3")String boxType3); |
| | | List<LocDetl> queryStockAll(@Param("orderNo")String orderNo, @Param("locNos") Set<String> locNos, @Param("matnr")String matnr, @Param("batch")String batch, |
| | | @Param("brand")String brand,@Param("standby1")String standby1,@Param("standby2")String standby2, |
| | | @Param("standby3")String standby3,@Param("boxType1")String boxType1,@Param("boxType2")String boxType2,@Param("boxType3")String boxType3); |
| | | @Param("standby3")String standby3,@Param("boxType1")String boxType1,@Param("boxType2")String boxType2); |
| | | |
| | | Double queryStockAnfme(String matnr, String batch); |
| | | |
| | |
| | | |
| | | List<LocDetl> queryStock(String matnr, String batch, String orderNo, Set<String> locNos); |
| | | |
| | | 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, 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); |
| | | |
| | | Double queryStockAnfme(String matnr, String batch); |
| | | |
| | |
| | | |
| | | |
| | | |
| | | // @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) { |
| | | // return this.baseMapper.queryStockAll(orderNo,locNos, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3); |
| | | // } |
| | | @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) { |
| | | return this.baseMapper.queryStockAll(orderNo,locNos, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2,boxType3); |
| | | 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) { |
| | | return this.baseMapper.queryStockAll(orderNo,locNos, matnr, batch,brand,standby1,standby2,standby3,boxType1,boxType2); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | @Transactional |
| | | public void startupFullTakeStore(StockOutParam param, Long userId) { |
| | | // 目标站点状态检测 |
| | | BasDevp staNo = basDevpService.checkSiteStatus(param.getOutSite()); |
| | | // 获取库位明细 |
| | | List<LocDetlDto> locDetlDtos = new ArrayList<>(); |
| | | for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) { |
| | | LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch(),paramLocDetl.getBrand() |
| | | ,paramLocDetl.getStandby1(),paramLocDetl.getStandby2(),paramLocDetl.getStandby3(),paramLocDetl.getBoxType1(),paramLocDetl.getBoxType2(),paramLocDetl.getBoxType3()); |
| | | if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount())); |
| | | try{ |
| | | // 目标站点状态检测 |
| | | BasDevp staNo = basDevpService.checkSiteStatus(param.getOutSite()); |
| | | // 获取库位明细 |
| | | List<LocDetlDto> locDetlDtos = new ArrayList<>(); |
| | | for (StockOutParam.LocDetl paramLocDetl : param.getLocDetls()) { |
| | | if (!Cools.isEmpty(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getCount())) { |
| | | LocDetl one = locDetlService.selectItem(paramLocDetl.getLocNo(), paramLocDetl.getMatnr(), paramLocDetl.getBatch(),paramLocDetl.getBrand() |
| | | ,paramLocDetl.getStandby1(),paramLocDetl.getStandby2(),paramLocDetl.getStandby3(),paramLocDetl.getBoxType1(),paramLocDetl.getBoxType2(),paramLocDetl.getBoxType3()); |
| | | if (null != one) locDetlDtos.add(new LocDetlDto(one, paramLocDetl.getCount())); |
| | | } |
| | | } |
| | | } |
| | | if (!locDetlDtos.isEmpty()) { |
| | | // 库位号集合 |
| | | List<String> locNoList = param.getLocDetls().stream().map(StockOutParam.LocDetl::getLocNo).distinct().collect(Collectors.toList()); |
| | | String firstFrozenLocNo = locMastMapper.findFirstFrozenLocNo(locNoList); |
| | | if (firstFrozenLocNo != null) { |
| | | throw new CoolException(firstFrozenLocNo + "库位已被冻结!"); |
| | | if (!locDetlDtos.isEmpty()) { |
| | | // 库位号集合 |
| | | List<String> locNoList = param.getLocDetls().stream().map(StockOutParam.LocDetl::getLocNo).distinct().collect(Collectors.toList()); |
| | | String firstFrozenLocNo = locMastMapper.findFirstFrozenLocNo(locNoList); |
| | | if (firstFrozenLocNo != null) { |
| | | throw new CoolException(firstFrozenLocNo + "库位已被冻结!"); |
| | | } |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo())); |
| | | if (locMast.getLocSts().equals("F") || locMast.getLocSts().equals("D") ){ |
| | | // 启动出库开始 101.出库 |
| | | stockOut(staNo, locDetlDtos, null, userId); |
| | | }else { |
| | | throw new CoolException("所选库位存在状态不为F、D的库位,库位号:"+locMast.getLocNo()+" 、当前状态:"+locMast.getLocSts()+"-"+locMast.getLocSts$()); |
| | | } |
| | | } else { |
| | | throw new CoolException("库存不存在"); |
| | | } |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", locDetlDtos.get(0).getLocDetl().getLocNo())); |
| | | if (locMast.getLocSts().equals("F") || locMast.getLocSts().equals("D") ){ |
| | | // 启动出库开始 101.出库 |
| | | stockOut(staNo, locDetlDtos, null, userId); |
| | | }else { |
| | | throw new CoolException("所选库位存在状态不为F、D的库位,库位号:"+locMast.getLocNo()+" 、当前状态:"+locMast.getLocSts()+"-"+locMast.getLocSts$()); |
| | | } |
| | | } else { |
| | | throw new CoolException("库存不存在"); |
| | | } catch (Exception e){ |
| | | throw new CoolException(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | throw new CoolException("预约库位状态失败,库位号:"+dto.getLocNo()); |
| | | } |
| | | } else { |
| | | log.error(dto.getLocNo() + "库位不是在库状态"); |
| | | throw new CoolException(dto.getLocNo() + "库位不是在库状态"); |
| | | } |
| | | |
| | |
| | | // 增加AGV库存中转数量 |
| | | if (basAgvLocDetls != null){ |
| | | for (BasAgvLocDetl basAgvLocDetl : basAgvLocDetls) { |
| | | basAgvLocDetlService.insert(basAgvLocDetl); |
| | | try{ |
| | | basAgvLocDetlService.insert(basAgvLocDetl); |
| | | } catch (Exception e){ |
| | | log.error("增加AGV库存中转数量失败"); |
| | | } |
| | | } |
| | | } |
| | | if (basAgvWrkDetls != null){ |
| | | for (BasAgvWrkDetl basAgvWrkDetl : basAgvWrkDetls) { |
| | | basAgvWrkDetlService.insert(basAgvWrkDetl); |
| | | try{ |
| | | basAgvWrkDetlService.insert(basAgvWrkDetl); |
| | | } catch (Exception e){ |
| | | log.error("增加AGV库存中转数量失败"); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | // jsonObject.put("start_biztime", latestUpdateTime);//业务起始日期 |
| | | jsonObject.put("start_biztime", "2025-01-01 00:00:00");//业务起始日期 |
| | | jsonObject.put("end_biztime", sdf1.format(now));//业务结束日期 |
| | | jsonObject.put("billno", null); |
| | | jsonObject.put("billno", "CGSL-251125-000001"); |
| | | jsonObject.put("billstatus", Arrays.asList("C"));//数据状态 [A:暂存, B:已提交, C:已审核] |
| | | jsonObject.put("start_auditdate", "2025-11-25 00:00:00"); |
| | | jsonObject.put("end_auditdate", sdf1.format(now)); |
| | |
| | | Double width = jsonObjectNew.get("width") != null ? new BigDecimal(jsonObjectNew.get("eap7_decimalfield8").toString()).doubleValue() : 0.0; |
| | | Double length = jsonObjectNew.get("length") != null ? new BigDecimal(jsonObjectNew.get("eap7_decimalfield7").toString()).doubleValue() : 0.0; |
| | | Double netweight = jsonObjectNew.get("netweight") != null ? new BigDecimal(jsonObjectNew.get("eap7_decimalfield").toString()).doubleValue() : 0.0; |
| | | // ---- 排序逻辑 ---- |
| | | List<Double> dims = Arrays.asList(height, width, length); |
| | | dims.sort(Double::compareTo); // 升序排列:最小、中间、最大 |
| | | Double min = dims.get(0)*10; |
| | | Double mid = dims.get(1)*10; |
| | | Double max = dims.get(2)*10; |
| | | // 生成商品档案 |
| | | Mat mat = matService.selectByMatnr(matnr); |
| | | if (mat == null) { |
| | |
| | | mat.setTagId(tag.getId()); |
| | | mat.setWeight(grossweight);//净重 |
| | | mat.setUnits(netweight);//毛重 |
| | | mat.setManLength(max); |
| | | mat.setHeight(min); |
| | | mat.setWidth(mid); |
| | | mat.setManLength(length*10); |
| | | mat.setHeight(height*10); |
| | | mat.setWidth(width*10); |
| | | mat.setCreateTime(sdf1.parse(createTime)); |
| | | mat.setUpdateTime(modifyTime); |
| | | mat.setStatus(1); |
| | |
| | | callApiLogSaveOrder(order, kingDeeUtilType, "创建入库单成功!单号:" + billNo, true); |
| | | } |
| | | } |
| | | String suppCode = jsonObjectNew2.getString("supplier_number"); //供应商 |
| | | |
| | | JSONArray billEntryArray = jsonObjectNew2.getJSONArray("billentry"); |
| | | for (int k = 0; k < billEntryArray.size(); k++) { |
| | | JSONObject entry = billEntryArray.getJSONObject(k); |
| | |
| | | String s2 = entry.getString("eap7_textfield5"); //条码UPC |
| | | String memo = entry.getString("eap7_textfield6"); //备注(英文描述) |
| | | String s1 = entry.getString("eap7_textfield7"); //客户PO |
| | | String suppCode = entry.getString("supplier_number"); //供应商 |
| | | if(anfme == 0){ |
| | | callApiLogSaveOrder(order,kingDeeUtilType, "单据数量异常"+matnr, false); |
| | | continue; |
| | |
| | | public enum KingDeeUtilType { |
| | | BD_MATERIAL(0, "物料档案","BD_MATERIAL","","","",1), |
| | | BD_RRGANIZATION(2, "供应商","BD_RRGANIZATION","","","",1), |
| | | PUR_RECEIVEBIll(3, "收料单","PUR_RECEIVEBIll","","","",1), |
| | | // PUR_RECEIVEBIll(3, "收料单","PUR_RECEIVEBIll","","","",1), |
| | | |
| | | // STK_InStock(1, "采购入库单","STK_InStock","FRealQty","","",1), |
| | | // PUR_MRB(2, "采购退料单","PUR_MRB","FRMREALQTY","","",1), |
| | |
| | | #计时器上报开关 |
| | | ErpReportOld: true |
| | | #获取单据开关 |
| | | InboundOrderSwitch: true |
| | | InboundOrderSwitch: false |
| | | #登录接口开关 |
| | | LoginAuthenticationSwitch: true |
| | | LoginAuthenticationSwitch: false |
| | | #上报、审核单据开关 |
| | | ReviewOrderSwitch: false |
| | | # 地址 |
| | |
| | | {type: 'numbers'}, |
| | | {field: 'matnr', title: '商品编号', width: 160}, |
| | | {field: 'maktx', title: '名称', width: 80}, |
| | | {field: 'boxType3', title: '采购单号'}, |
| | | {field: 'standby1', title: '客户PO'}, |
| | | {field: 'standby2', title: 'UPC'}, |
| | | {field: 'standby3', title: '客户SKU'}, |
| | | {field: 'boxType1', title: '货主'}, |
| | | {field: 'boxType3', title: '采购单号'}, |
| | | {field: 'anfme', title: '数量', width: 80}, |
| | | {field: 'qty', title: '上报数量', style: 'font-weight: bold'}, |
| | | {field: 'workQty', title: '历史上报数量'}, |
| | |
| | | {field: 'maktx', title: '名称', width: 80}, |
| | | // {field: 'batch', title: '批号', edit: true}, |
| | | // {field: 'specs', title: '规格'}, |
| | | {field: 'standby1', title: 'po'}, |
| | | {field: 'standby2', title: 'upc'}, |
| | | {field: 'standby3', title: '客户SKU'}, |
| | | {field: 'boxType1', title: '货主名称'}, |
| | | {field: 'boxType2', title: 'upc'}, |
| | | {field: 'boxType3', title: '客户SKU'}, |
| | | {field: 'standby1', title: 'po',edit: true}, |
| | | {field: 'standby2', title: 'upc',edit: true}, |
| | | {field: 'standby3', title: '客户SKU',edit: true}, |
| | | {field: 'boxType1', title: '货主名称',edit: true}, |
| | | {field: 'boxType2', title: '货主编号',edit: true}, |
| | | {field: 'boxType3', title: '采购单号',edit: true}, |
| | | {field: 'anfme', title: '数量(修改)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110}, |
| | | {field: 'workQty', title: '作业数量', minWidth: 100, width: 100}, |
| | | // {field: 'unit', title: '单位', width: 80}, |
| | |
| | | ,{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: '规格',hide:true} |
| | | // ,{field: 'batch', align: 'center',title: '序列码',hide:true} |
| | | // ,{field: 'specs', align: 'center',title: '规格',hide:true} |
| | | ,{field: 'standby1', align: 'center',title: 'po', hide: false} |
| | | ,{field: 'standby2', align: 'center',title: 'upc', hide: false} |
| | | // ,{field: 'anfme', align: 'center',title: '数量'} |
| | |
| | | {type: 'numbers'}, |
| | | {field: 'matnr', title: '商品编号', width: 160}, |
| | | {field: 'maktx', title: '名称', width: 160}, |
| | | {field: 'standby3', title: '客户SKU'}, |
| | | {field: 'boxType1', title: '货主'}, |
| | | {field: 'boxType3', title: '采购单号'}, |
| | | // {field: 'batch', title: '批号'} |
| | | {field: 'standby1', align: 'center',title: 'po', hide: false}, |
| | | {field: 'standby2', align: 'center',title: 'upc', hide: false}, |
| | | {field: 'standby1', align: 'center',title: '客户PO', hide: false}, |
| | | {field: 'standby2', align: 'center',title: 'UPC', hide: false}, |
| | | {field: 'anfme', title: '数量'}, |
| | | {field: 'workQty', title: '作业数量'}, |
| | | {field: 'qty', title: '完成数量', style: 'font-weight: bold'}, |
| | |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | | {field: 'matnr', title: '商品编号', width: 160}, |
| | | {field: 'maktx', title: '名称', width: 80} |
| | | ,{field: 'standby1', align: 'center',title: 'po', hide: false} |
| | | ,{field: 'standby2', align: 'center',title: 'upc', hide: false}, |
| | | {field: 'maktx', title: '名称', width: 80}, |
| | | {field: 'standby3', title: '客户SKU'}, |
| | | {field: 'boxType1', title: '货主'}, |
| | | {field: 'boxType3', title: '采购单号'}, |
| | | ,{field: 'standby1', align: 'center',title: '客户PO', hide: false} |
| | | ,{field: 'standby2', align: 'center',title: 'UPC', hide: false}, |
| | | // {field: 'batch', title: '批号'}, |
| | | // {field: 'anfme', title: '数量'}, |
| | | {field: 'workQty', title: '作业数量'}, |
| | |
| | | <!-- lay-verify="required"--> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">客户PO:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="standby1" name="standby1" placeholder="输入客户PO" type="text" class="layui-input" maxlength="20" lay-verType="tips" /> |
| | | <!-- lay-verify="required"--> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">货主:</label> |
| | | <div class="layui-input-block"> |
| | | <input id="owner" name="owner" placeholder="输入货主" type="text" class="layui-input" maxlength="20" lay-verType="tips" /> |
| | | <!-- lay-verify="required"--> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">客户PO:</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input id="standby1" name="standby1" placeholder="输入客户PO" type="text" class="layui-input" maxlength="20" lay-verType="tips" />--> |
| | | <!-- <!– lay-verify="required"–>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">货主:</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input id="owner" name="owner" placeholder="输入货主" type="text" class="layui-input" maxlength="20" lay-verType="tips" />--> |
| | | <!-- <!– lay-verify="required"–>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">货主:</label>--> |
| | | <!-- <div class="layui-input-block cool-auto-complete">--> |