| | |
| | | jsonObject.put("end_modifytime", sdf1.format(now));//更新截止 |
| | | jsonObject.put("start_approvedate", "2025-01-01");//审核起始 |
| | | jsonObject.put("end_approvedate", sdf2.format(now));//审核截止 |
| | | jsonObject.put("status", Arrays.asList("B", "C"));//数据状态 [A:暂存, B:已提交, C:已审核] |
| | | jsonObject.put("status", Arrays.asList("C"));//数据状态 [A:暂存, B:已提交, C:已审核] |
| | | path = matAddress; |
| | | break; |
| | | case "BD_RRGANIZATION": //供应商同步 |
| | |
| | | case "PUR_RECEIVEBIll": //已审核收料单查询 |
| | | // 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", Arrays.asList("CGSL-251023-000027","CGSL-250811-000028")); |
| | | jsonObject.put("billno", null); |
| | | jsonObject.put("billstatus", Arrays.asList("C"));//数据状态 [A:暂存, B:已提交, C:已审核] |
| | | jsonObject.put("start_auditdate", null);//id |
| | | jsonObject.put("end_auditdate", null); |
| | | jsonObject.put("start_auditdate", "2025-11-25 00:00:00"); |
| | | jsonObject.put("end_auditdate", sdf1.format(now)); |
| | | jsonObject.put("org_number", null); |
| | | jsonObject.put("supplier_number", null); |
| | | path = imPurreceiveBillAddress; |
| | |
| | | String matnr = jsonObjectNew.get("number").toString(); |
| | | String name = jsonObjectNew.get("name").toString(); |
| | | String createTime = jsonObjectNew.get("createtime").toString(); |
| | | Double grossweight = jsonObjectNew.get("grossweight") != null ? new BigDecimal(jsonObjectNew.get("grossweight").toString()).doubleValue() : 0.0; |
| | | Double height = jsonObjectNew.get("height") != null ? new BigDecimal(jsonObjectNew.get("height").toString()).doubleValue() : 0.0; |
| | | Double width = jsonObjectNew.get("width") != null ? new BigDecimal(jsonObjectNew.get("width").toString()).doubleValue() : 0.0; |
| | | Double length = jsonObjectNew.get("length") != null ? new BigDecimal(jsonObjectNew.get("length").toString()).doubleValue() : 0.0; |
| | | Double netweight = jsonObjectNew.get("netweight") != null ? new BigDecimal(jsonObjectNew.get("grossweight").toString()).doubleValue() : 0.0; |
| | | Double grossweight = jsonObjectNew.get("grossweight") != null ? new BigDecimal(jsonObjectNew.get("eap7_decimalfield6").toString()).doubleValue() : 0.0; |
| | | Double height = jsonObjectNew.get("height") != null ? new BigDecimal(jsonObjectNew.get("eap7_decimalfield9").toString()).doubleValue() : 0.0; |
| | | 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(length); |
| | | mat.setHeight(height); |
| | | mat.setWidth(width); |
| | | mat.setManLength(max); |
| | | mat.setHeight(min); |
| | | mat.setWidth(mid); |
| | | mat.setCreateTime(sdf1.parse(createTime)); |
| | | mat.setUpdateTime(modifyTime); |
| | | mat.setStatus(1); |
| | |
| | | if (ownerUuid != null) { |
| | | locOwner = locOwnerService.selectByUuid(ownerUuid); |
| | | if (locOwner == null) { |
| | | callApiLogSaveOrder(order,kingDeeUtilType, "货主检索失败,请先添加对应货主编号:"+ownerUuid, false);continue; |
| | | callApiLogSaveOwner(locOwner,kingDeeUtilType, "货主检索失败,请先添加对应货主编号:"+ownerUuid+"名称"+owner, false);continue; |
| | | } |
| | | } else{ |
| | | callApiLogSaveOrder(order,kingDeeUtilType, "货主检索失败,未查询到货主编号!", false);continue; |
| | | callApiLogSaveOwner(locOwner,kingDeeUtilType, "货主检索失败,未查询到货主编号!", false);continue; |
| | | } |
| | | if (Cools.isEmpty(order)) { |
| | | // 单据主档 |
| | |
| | | now, // 添加时间 |
| | | 9527L, // 修改人员 |
| | | now, // 修改时间 |
| | | null // 备注 |
| | | null, // 备注 |
| | | kingDeeUtilType.pakIn !=1?2:1 |
| | | ); |
| | | if( orderService.insert(order)){ |
| | | callApiLogSaveOrder(order, kingDeeUtilType, "创建入库单成功!单号:" + billNo, true); |
| | |
| | | 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; |
| | | } |
| | | //物料编码 |
| | | Mat mat = matService.selectByMatnr(matnr); |
| | | if (Cools.isEmpty(mat)) { |
| | |
| | | "货主编号:" + locSupp.getOwnerUuid() + "、货主名称:" + locSupp.getOwner(), |
| | | response, bool); |
| | | } |
| | | public void callApiLogSaveOwner(LocOwner locOwner, KingDeeUtilType kingDeeUtilType, String response, Boolean bool) { |
| | | apiLogService.save("获取"+kingDeeUtilType.desc, kingDeeUtilType.formId, "null", URL, |
| | | "货主编号:" + locOwner.getOwnerUuid() + "、货主名称:" + locOwner.getOwner(), |
| | | response, bool); |
| | | } |
| | | |
| | | public void callApiLogSaveOrder(Order order, KingDeeUtilType kingDeeUtilType, String response, Boolean bool) { |
| | | apiLogService.save("获取"+kingDeeUtilType.desc, kingDeeUtilType.formId, "null", URL, |
| | | "单据编号:" + order.getId() + "、状态:" + order.getStatus$(), |
| | | "单据编号:" + order.getOrderNo() + "、状态:" + order.getStatus$(), |
| | | response, bool); |
| | | } |
| | | |