| | |
| | | wrapper.orderBy("create_time",false); |
| | | return R.ok(basArmMastService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | @RequestMapping(value = "/basArmMast/listArm/auth") |
| | | @ManagerAuth |
| | | public R listArm(@RequestParam(defaultValue = "1") Integer curr, |
| | | @RequestParam(defaultValue = "10") Integer limit, |
| | | @RequestParam(required = false) String orderByField, |
| | | @RequestParam(required = false) String orderByType, |
| | | @RequestParam(required = false) String condition, |
| | | @RequestParam Map<String, Object> param) { |
| | | EntityWrapper<BasArmMast> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(BasArmMast.class, param.keySet(), wrapper, condition); |
| | | |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } |
| | | wrapper.orderBy("create_time", false); |
| | | |
| | | // 如果不需要分页,使用 selectList() 获取所有数据 |
| | | List<BasArmMast> allData = basArmMastService.selectList(wrapper); |
| | | |
| | | return R.ok(allData); // 直接返回所有数据 |
| | | } |
| | | |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | |
| | | private InboundOrderHandler inboundOrderHandler; |
| | | @Value("${erp.switch.InboundOrderSwitch}") |
| | | private boolean InboundOrderSwitch; |
| | | // 每15分钟同步一次物料档案,防止档案位同步单据先获取 |
| | | @Scheduled(cron = "0 */15 * * * ?") |
| | | void syncMaterialData() { |
| | | if (!InboundOrderSwitch) { |
| | | return; |
| | | } |
| | | inboundOrderHandler.syncMaterialData(); // 同步物料档案 |
| | | } |
| | | |
| | | @Scheduled(cron = "0 */30 * * * ?") |
| | | // @Scheduled(cron = "0/5 * * * * ?") |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | List<Order> orders = orderService.selectComplete(); |
| | | if(orders.size() > 0){ |
| | | for (Order order : orders) { |
| | | if((order.getDocType() == 3 || order.getDocType() == 16 || order.getDocType() == 23) && order.getPayType() == null){ //走新增提交审核流程 |
| | | if((order.getDocType() == 3 || order.getDocType() == 16 || order.getDocType() == 23 || order.getDocType() == 24) && order.getPayType() == null){ //走新增提交审核流程 |
| | | ReturnT<String> result = saveOrderSyncHandler.start(order);//4已完成 |
| | | if (!result.isSuccess()) { |
| | | log.error("单据[orderNo={}]新增保存至erp失败", order.getOrderNo()); |
| | |
| | | @Value("${erp.address.qcppManuinspec}") |
| | | //产品检验单 |
| | | private String qcppManuinspec; |
| | | |
| | | @Value("${erp.address.omOutsourcereceiptQuery}") |
| | | //委外入库单 |
| | | private String omOutsourcereceiptQuery; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | |
| | |
| | | jsonObject.put("org_number", null); |
| | | jsonObject.put("supplier_number", null); |
| | | path = imPurreceiveBillAddress; |
| | | break; |
| | | case "OUI_RECEIVEBIll"://委外入库单 |
| | | jsonObject.put("billstatus", Arrays.asList("C"));//数据状态 [A:暂存, B:已提交, C:已审核] |
| | | jsonObject.put("auditdate_start", latestUpdateTime); |
| | | jsonObject.put("auditdate_end", sdf1.format(now)); |
| | | path = omOutsourcereceiptQuery; |
| | | break; |
| | | case "SAL_OUTSTOCK"://销售出库单查询 |
| | | path = imSaloutbill; |
| | |
| | | docTypeService.updateById(docType); |
| | | } |
| | | //生产汇报单 |
| | | else if(kingDeeUtilType.formId.equals("PRD_MORPT")) { |
| | | else if(kingDeeUtilType.formId.equals("PRD_MORPT") || kingDeeUtilType.formId.equals("OUI_RECEIVEBIll")) { |
| | | int pageSize = jsonResponse.getJSONObject("data").getIntValue("pageSize"); |
| | | int totalCount = jsonResponse.getJSONObject("data").getIntValue("totalCount"); |
| | | int totalPages = (int) Math.ceil((double) totalCount / pageSize); |
| | |
| | | Long seq = entry.getLong("seq"); //分录行号 |
| | | String manubill = entry.getString("manufacturenun"); |
| | | String manubillid = entry.getString("orderid_id"); |
| | | String manuentryid = entry.getString("mftentryid"); |
| | | String manuentryid = null; |
| | | String manuentry = null; |
| | | if(kingDeeUtilType.formId.equals("PRD_MORPT")){ |
| | | manuentryid = entry.getString("mftentryid"); |
| | | |
| | | }else{ |
| | | manuentryid = entry.getString("osentryid"); |
| | | manuentry = entry.getString("manufacturerow"); |
| | | } |
| | | String suppCode = null; |
| | | if (anfme == null || anfme == 0) { |
| | | callApiLogSaveOrder(order, kingDeeUtilType, |
| | |
| | | orderDetl.sync(mat); |
| | | orderDetl.setModel(manubillid);//orderid_id |
| | | orderDetl.setBrand(manuentryid);//manuentryid |
| | | orderDetl.setSpecs(manuentry);//manufacturerow |
| | | orderDetl.setColor(manubill);//manufacturenun |
| | | orderDetl.setThreeCode(detlId); |
| | | orderDetl.setLineNumber(seq); |
| | | orderDetl.setAnfme(anfmeBox); |
| | |
| | | return SUCCESS; |
| | | } |
| | | |
| | | public synchronized ReturnT<String> syncMaterialData(){ |
| | | SimpleDateFormat sdf1=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | SimpleDateFormat sdf2=new SimpleDateFormat("yyyy-MM-dd"); |
| | | //读取token |
| | | ErpSecret erpSecret = erpSecretService.selectOne(new EntityWrapper<ErpSecret>().eq("account_id", accountId)); |
| | | for(KingDeeUtilType kingDeeUtilType : KingDeeUtilType.values()) { |
| | | if (!kingDeeUtilType.formId.equals("BD_MATERIAL")) { |
| | | continue; |
| | | } |
| | | DocType docType = docTypeService.selectOne(new EntityWrapper<DocType>().eq("doc_name", kingDeeUtilType.desc)); |
| | | if (Cools.isEmpty(docType) && !kingDeeUtilType.formId.equals("BD_MATERIAL")) { |
| | | docType = docTypeService.selectOrAdd(kingDeeUtilType.desc, kingDeeUtilType.pakIn.equals(1)); |
| | | } |
| | | //条件和需要获得的结果拼接 |
| | | JSONObject jsonObject = new JSONObject(); |
| | | String path = null; |
| | | Date now = new Date(); |
| | | String latestUpdateTime = sdf1.format(docType.getUpdateTime()); |
| | | switch (kingDeeUtilType.formId) { |
| | | case "BD_MATERIAL": //物料同步 |
| | | jsonObject.put("id", null);//id |
| | | jsonObject.put("number", null);//编码 |
| | | jsonObject.put("createorg_number", null);//创建组织 |
| | | jsonObject.put("start_createtime", "2025-01-01 00:00:00");//创建起始 |
| | | jsonObject.put("end_createtime", sdf1.format(now));//创建截止 |
| | | jsonObject.put("start_modifytime", latestUpdateTime);//更新起始 |
| | | 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("C"));//数据状态 [A:暂存, B:已提交, C:已审核] |
| | | path = matAddress; |
| | | break; |
| | | } |
| | | if (path == null) { |
| | | continue; |
| | | } |
| | | JSONObject jsonObject1 = new JSONObject(); |
| | | jsonObject1.put("data", jsonObject); |
| | | jsonObject1.put("pageSize", 20); |
| | | jsonObject1.put("pageNo", 1); |
| | | String add = jsonObject1.toJSONString(); |
| | | //上报 |
| | | String response = ""; |
| | | boolean success = false; |
| | | if (path == null) { |
| | | continue; |
| | | } |
| | | try { |
| | | //获取Cookie值 |
| | | HashMap<String, Object> headers = new HashMap<>(); |
| | | headers.put("accesstoken", erpSecret.getAccessToken()); |
| | | headers.put("x-acgw-identity", xAcfwIdentity); // 自定义请求头 |
| | | response = new HttpHandler.Builder() |
| | | .setHeaders(headers) |
| | | .setUri(URL) |
| | | .setPath(path) |
| | | .setJson(add) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonResponse = JSON.parseObject(response); |
| | | if (jsonResponse.getString("errorCode").equals("401")) { |
| | | log.error("检索失败错误信息:{}", jsonResponse.getString("message")); |
| | | loginAuthenticationHandler.start(); |
| | | continue; |
| | | } |
| | | JSONArray data = jsonResponse.getJSONObject("data").getJSONArray("rows"); |
| | | if (data.size() <= 0) continue; |
| | | //商品档案同步 |
| | | if (kingDeeUtilType.formId.equals("BD_MATERIAL")) { |
| | | Tag tag = tagService.selectByName("全部", 1); |
| | | // 处理分页:根据返回的totalCount和pageSize计算页数 |
| | | int pageSize = jsonResponse.getJSONObject("data").getIntValue("pageSize"); |
| | | int totalCount = jsonResponse.getJSONObject("data").getIntValue("totalCount"); |
| | | int totalPages = (int) Math.ceil((double) totalCount / pageSize); |
| | | |
| | | for (int page = 1; page <= totalPages; page++) { |
| | | jsonObject1.put("pageNo", page); |
| | | add = jsonObject1.toJSONString(); |
| | | // 重新发起请求以获取该页的数据 |
| | | response = new HttpHandler.Builder() |
| | | .setHeaders(headers) |
| | | .setUri(URL) |
| | | .setPath(path) |
| | | .setJson(add) |
| | | .build() |
| | | .doPost(); |
| | | |
| | | jsonResponse = JSON.parseObject(response); |
| | | data = jsonResponse.getJSONObject("data").getJSONArray("rows"); |
| | | for (int j = 0; j < data.size(); j++) { |
| | | JSONObject jsonObjectNew = data.getJSONObject(j); |
| | | Date modifyTime = sdf1.parse(jsonObjectNew.get("modifytime").toString()); |
| | | String matnr = jsonObjectNew.get("number").toString(); |
| | | String name = jsonObjectNew.get("name").toString(); |
| | | String createTime = jsonObjectNew.get("createtime").toString(); |
| | | Double height = getDecimalFieldAsDouble(jsonObjectNew, "eap7_decimalfield9"); |
| | | Double width = getDecimalFieldAsDouble(jsonObjectNew, "eap7_decimalfield8"); |
| | | Double length = getDecimalFieldAsDouble(jsonObjectNew, "eap7_decimalfield7"); |
| | | Double grossweight = getDecimalFieldAsDouble(jsonObjectNew, "eap7_decimalfield6"); |
| | | Double netweight = getDecimalFieldAsDouble(jsonObjectNew, "eap7_decimalfield"); |
| | | Double unit = getDecimalFieldAsDouble(jsonObjectNew, "eap7_decimalfield2"); |
| | | // 生成商品档案 |
| | | Double height1 = height * 10; |
| | | Double width1 = width * 10; |
| | | Double length1 = length * 10; |
| | | Mat mat = matService.selectByMatnr(matnr); |
| | | if (mat == null) { |
| | | mat = new Mat(); |
| | | mat.setMatnr(matnr); |
| | | mat.setMaktx(name); |
| | | mat.setTagId(tag.getId()); |
| | | mat.setWeight(grossweight);//净重 |
| | | mat.setUnits(netweight);//毛重 |
| | | mat.setSafeQty(unit);// |
| | | mat.setManLength(length1); |
| | | mat.setHeight(height1); |
| | | mat.setWidth(width1); |
| | | mat.setCreateTime(sdf1.parse(createTime)); |
| | | mat.setUpdateTime(modifyTime); |
| | | mat.setStatus(1); |
| | | if (!matService.insert(mat)) { |
| | | callApiLogSaveMat(mat, kingDeeUtilType, "同步新物料出错!" + mat, false); |
| | | log.info("同步新物料出错!参数:[{}]、[{}]", mat, jsonObjectNew); |
| | | } else { |
| | | callApiLogSaveMat(mat, kingDeeUtilType, "同步新物料成功!", true); |
| | | success = true; |
| | | } |
| | | } else { |
| | | boolean isUpdated = false; |
| | | if (mat.getUpdateTime().compareTo(modifyTime) != 0) { |
| | | // 更新字段 |
| | | if (!mat.getMaktx().equals(name)) mat.setMaktx(name); |
| | | if (mat.getWeight().compareTo(grossweight) != 0) mat.setWeight(grossweight); |
| | | if (mat.getUnits().compareTo(netweight) != 0) mat.setUnits(netweight); |
| | | if (mat.getSafeQty().compareTo(unit) != 0) mat.setSafeQty(unit); |
| | | if (mat.getManLength().compareTo(length) != 0) mat.setManLength(length1); |
| | | if (mat.getHeight().compareTo(height) != 0) mat.setHeight(height1); |
| | | if (mat.getWidth().compareTo(width) != 0) mat.setWidth(width1); |
| | | if (mat.getCreateTime().compareTo(sdf1.parse(createTime)) != 0) |
| | | mat.setCreateTime(sdf1.parse(createTime)); |
| | | mat.setUpdateTime(modifyTime); |
| | | isUpdated = true; |
| | | } |
| | | // 执行更新操作 |
| | | if (isUpdated) { |
| | | if (!matService.updateById(mat)) { |
| | | callApiLogSaveMat(mat, kingDeeUtilType, "更新物料出错!" + mat, false); |
| | | log.info("更新物料[商品编号:{}], 更新失败!", mat.getMatnr()); |
| | | } else { |
| | | callApiLogSaveMat(mat, kingDeeUtilType, "更新物料成功!", true); |
| | | success = true; |
| | | log.info("更新物料[商品编号:{}]", mat.getMatnr()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (success) { |
| | | docType.setUpdateTime(now); |
| | | docTypeService.updateById(docType); |
| | | } |
| | | } |
| | | }catch (Exception e) { |
| | | log.error("fail", e); |
| | | return FAIL.setMsg(e.getMessage()); |
| | | } |
| | | } |
| | | return SUCCESS; |
| | | } |
| | | |
| | | public void callApiLogSaveMat(Mat mat, KingDeeUtilType kingDeeUtilType, String response, Boolean bool) { |
| | | apiLogService.save("获取"+kingDeeUtilType.desc, kingDeeUtilType.formId, "null", URL, |
| | | "物料编号:" + mat.getMatnr() + "、物料名称:" + mat.getMaktx() + "、毛重:" + mat.getWeight() |
| | |
| | | @Value("${erp.address.imOtherinbillAudit}") |
| | | //其他入库审核上报 |
| | | private String imOtherinbillAudit; |
| | | |
| | | @Value("${erp.address.imMdcOmprdinbillBatchAudit}") |
| | | //其他入库审核上报 |
| | | private String imMdcOmprdinbillBatchAudit; |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | |
| | | idArray.add(order.getShipCode()); |
| | | dataObj.fluentPut("billno", idArray); |
| | | return new JSONObject().fluentPut("data", dataObj); |
| | | case "OUI_RECEIVEBIll": |
| | | path = imMdcOmprdinbillBatchAudit; |
| | | idArray.add(order.getShipCode()); |
| | | dataObj.fluentPut("billno", idArray); |
| | | return new JSONObject().fluentPut("data", dataObj); |
| | | case "SAL_RETURNSTOCK"://销售退料单 |
| | | path = scpSalreturnReport; |
| | | dataObj.fluentPut("billno", order.getOrderNo()); |
| | |
| | | idArray.add(order.getNumber()); |
| | | dataObj.fluentPut("ids", idArray); |
| | | return new JSONObject().fluentPut("data", dataObj); |
| | | |
| | | case "STK_MISCELLANEOUS"://其他入库单 |
| | | path = imOtheroutbillAudi; |
| | | idArray.add(order.getId()); |
| | |
| | | order.setDocType(23L); |
| | | order.setSettle(4L);//转为出库单据上报 |
| | | }else{ |
| | | if(order.getDocType() == 23L){ |
| | | if(order.getDocType() == 23L || order.getDocType() == 24L){ |
| | | Order order1 = orderService.selectOne(new EntityWrapper<Order>().eq("salesman",order.getOrderNo())); |
| | | orderService.updateOrderStatus4(order1.getOrderNo()); |
| | | } |
| | |
| | | private String imProductinbillReport; |
| | | @Value("${erp.address.imSaloutbillSave}") |
| | | private String imSaloutbillSave; |
| | | |
| | | @Value("${erp.address.imMdcOmprdinbillSave}") |
| | | private String imMdcOmprdinbillSave; |
| | | @Autowired |
| | | private OrderService orderService; |
| | | @Autowired |
| | |
| | | |
| | | .fluentPut("billentry", billentryArray1) // 将 billentry 数组添加到请求参数 |
| | | ))); |
| | | case "OUI_RECEIVEBIll": |
| | | JSONArray billentryLkArray2 = new JSONArray(); |
| | | JSONArray billentryArray2 = new JSONArray(); // 用于存储 billentry 对象 |
| | | String suppCode2 = null; // 供应商 |
| | | String boxType22 = null; // 货主/货源 |
| | | Date now2 = new Date(); |
| | | path = imMdcOmprdinbillSave; |
| | | for (OrderDetl orderDetl : orderDetlList) { |
| | | suppCode2 = orderDetl.getSuppCode(); |
| | | boxType22 = orderDetl.getBoxType2(); |
| | | if (orderDetl.getQty() == 0) { |
| | | continue; |
| | | } |
| | | Mat mat = matService.selectByMatnr(orderDetl.getMatnr()); |
| | | Double qty = orderDetl.getQty()*mat.getSafeQty(); |
| | | // Double qtytotal = orderDetl.getAnfme()*mat.getSafeQty(); |
| | | // JSONArray idArr = new JSONArray(); |
| | | // idArr.add(0L); |
| | | // 创建 billentry_lk 对象 |
| | | JSONObject billentryLk = new JSONObject() |
| | | .fluentPut("id", 0L) |
| | | .fluentPut("seq", orderDetl.getLineNumber()) |
| | | .fluentPut("billentry_lk_stableid", 1014628189722381313L) |
| | | .fluentPut("billentry_lk_sbillid", Long.parseLong(order.getItemName())) // 主单ID |
| | | .fluentPut("billentry_lk_sid", Long.parseLong(orderDetl.getThreeCode())); // 明细ID |
| | | // .fluentPut("billentry_lk_baseqty_old", orderDetl.getErpAnfme()) // ERP数量 |
| | | // .fluentPut("billentry_lk_baseqty", qty); // 作业数量 |
| | | billentryLkArray2.add(billentryLk); |
| | | // 创建 billentry 对象,填充缺失的字段 |
| | | JSONObject billentry = new JSONObject() |
| | | .fluentPut("id", 0L) |
| | | .fluentPut("warehouse_number", orderDetl.getManu()) // 仓库编号 |
| | | .fluentPut("qty", qty) // 数量 |
| | | .fluentPut("baseqty", orderDetl.getErpAnfme()) |
| | | .fluentPut("ownertype", "bos_org") |
| | | .fluentPut("keepertype", "bos_org") |
| | | .fluentPut("outownertype", "bos_org") |
| | | .fluentPut("outkeepertype", "bos_org") |
| | | .fluentPut("keeper_number", "BU-00001") |
| | | .fluentPut("owner_number", "BU-00001") |
| | | .fluentPut("manuentry", orderDetl.getSpecs()) |
| | | .fluentPut("manubill", orderDetl.getColor()) |
| | | .fluentPut("manubillid", orderDetl.getModel()) |
| | | .fluentPut("manuentryid", orderDetl.getBrand()) |
| | | .fluentPut("producttype", "C") |
| | | .fluentPut("eap7_textfield", orderDetl.getBoxType3()) |
| | | |
| | | .fluentPut("unit_number", "pcs") |
| | | .fluentPut("baseunit_number", "pcs") |
| | | .fluentPut("warehouse_number", "CK-002") |
| | | .fluentPut("owner_number", "BU-00001") |
| | | .fluentPut("keeper_number", "BU-00001") |
| | | .fluentPut("invtype_number", "110") |
| | | .fluentPut("outowner_number", "BU-00001") |
| | | .fluentPut("outkeeper_number", "BU-00001") |
| | | .fluentPut("shipper_number", "BU-00001") |
| | | .fluentPut("entrysettleorg_number", "BU-00001") |
| | | .fluentPut("material_number", orderDetl.getMatnr()) |
| | | |
| | | .fluentPut("billentry_lk", billentryLkArray2); |
| | | |
| | | billentryArray2.add(billentry); |
| | | } |
| | | return new JSONObject() |
| | | .fluentPut("data", new JSONArray(Arrays.asList( |
| | | new JSONObject() |
| | | .fluentPut("billno", UUID.randomUUID().toString().replace("-", "").substring(0, 16)) |
| | | .fluentPut("billstatus", "C") |
| | | .fluentPut("id", 0L) |
| | | .fluentPut("biztime", sdf1.format(now2)) |
| | | .fluentPut("org_number", "BU-00001") |
| | | .fluentPut("billtype_number", "im_mdc_omprdinbill_BT_S") |
| | | .fluentPut("bizorg_number", "BU-00001") |
| | | .fluentPut("bizdept_number", "Org-00001") |
| | | .fluentPut("dept_number", "Org-00001") |
| | | .fluentPut("biztype_number", "605") |
| | | .fluentPut("invscheme_number", "601") |
| | | .fluentPut("purorg_number", "BU-00001") |
| | | .fluentPut("productionorg_number", "BU-00001") |
| | | .fluentPut("billentry", billentryArray2) // 将 billentry 数组添加到请求参数 |
| | | ))); |
| | | case "STK_imSaloutbill": |
| | | path = imSaloutbillSave; |
| | | billentryArray = new JSONArray(); |
| | |
| | | .fluentPut("bizdept_number", "Org-00002") |
| | | .fluentPut("org_number", "BU-00001") |
| | | .fluentPut("invscheme_number", "210") |
| | | .fluentPut("settlecurrency_number", "CNY") |
| | | .fluentPut("exchangerate", 1L) |
| | | |
| | | .fluentPut("billentry", billentryArray) |
| | | ))); |
| | | // case "STK_MISCELLANEOUS": // 其他入库单 |
| | |
| | | private String imProductinbillBatchSubmit; |
| | | @Value("${erp.address.imSaloutbillSaveSubmit}") |
| | | private String imSaloutbillSaveSubmit; |
| | | @Value("${erp.address.imMdcOmprdinbillBatchSubmit}") |
| | | private String imMdcOmprdinbillBatchSubmit; |
| | | @Autowired |
| | | private LoginAuthenticationHandler loginAuthenticationHandler; |
| | | @Autowired |
| | |
| | | idArray.add(order.getShipCode()); |
| | | dataObj.fluentPut("billno", idArray); |
| | | return new JSONObject().fluentPut("data", dataObj); |
| | | case "OUI_RECEIVEBIll": |
| | | path = imMdcOmprdinbillBatchSubmit; |
| | | idArray.add(order.getShipCode()); |
| | | dataObj.fluentPut("billno", idArray); |
| | | return new JSONObject().fluentPut("data", dataObj); |
| | | case "STK_MISCELLANEOUS"://其他入库单 |
| | | path = imOtherinbillSubmit; |
| | | idArray.add(order.getOrderNo()); |
| | |
| | | */ |
| | | public class HttpHandler { |
| | | |
| | | private static final Integer DEFAULT_TIMEOUT_SECONDS = 5; |
| | | private static final Integer DEFAULT_TIMEOUT_SECONDS = 10; |
| | | private static final MediaType MEDIA_TYPE = MediaType.parse("application/json;charset=utf-8"); |
| | | |
| | | private String uri; |
| | |
| | | PRD_ReturnMtrl(12, "生产退料单","PRD_ReturnMtrl","","","",1), |
| | | PRD_FeedMtrl(14, "生产补料单","PRD_FeedMtrl","","","",0), |
| | | PRD_MORPT(16, "生产汇报单","PRD_MORPT","","生产入库单","",1), |
| | | // (20, "委外入库单","STK_InspectionForm","","","",0), |
| | | OUI_RECEIVEBIll(24, "委外入库单","OUI_RECEIVEBIll","","","",1), |
| | | |
| | | // PUR_MRB(2, "采购退料单","PUR_MRB","FRMREALQTY","","",1), |
| | | // STK_TransferDirect(6, "直接调拨单","STK_TransferDirect","","FQty","",1), |
| | |
| | | tableIns = table.render({ |
| | | elem: '#basArmMastExp', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/basArmMast/list/auth', |
| | | url: baseUrl+'/basArmMast/listArm/auth', |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | |
| | | {field: 'matnr', align: 'center', title: '商品编号'}, |
| | | {field: 'po', align: 'center', title: 'PO'}, |
| | | {field: 'upc', align: 'center', title: 'UPC'}, |
| | | {field: 'sortingLine', align: 'center', title: '起点'}, |
| | | {field: 'staNo', align: 'center', title: '起点'}, |
| | | {field: 'status', align: 'center', title: '作业状态', templet: function(d){ |
| | | return '2.单码完成等待托盘完成'; // 因为现在只显示状态2,固定显示 |
| | | }}, |
| | |
| | | }; |
| | | } |
| | | |
| | | var records = res.data.records || []; |
| | | var records = res.data || []; |
| | | var groupMap = new Map(); // 用来汇总状态为2的数据 |
| | | |
| | | records.forEach(function(item) { |
| | | // 只处理状态为2的记录,其他状态直接忽略(隐藏) |
| | | |
| | | if (String(item.status) === '2') { |
| | | // 生成唯一标识(5个字段组合) |
| | | var key = [ |
| | | item.armNo || '', |
| | | item.sortingLine || '', |
| | | item.staNo || '', |
| | | item.barcode || '', |
| | | item.matnr || '', |
| | | item.orderNo || '' |
| | |
| | | matnr: item.matnr, |
| | | po: item.po || '', |
| | | upc: item.upc || '', |
| | | sortingLine: item.sortingLine, |
| | | staNo: item.staNo, |
| | | barcode: item.barcode, |
| | | supplier: item.supplier || '', |
| | | status: '2', // 固定显示为2 |
| | |
| | | // ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | | // ,{field: 'price', align: 'center',title: '单价', hide: true} |
| | | ,{field: 'standby2', align: 'center',title: '条码upc', hide: false} |
| | | ,{field: 'units', align: 'center',title: '单箱毛重kg', hide: true} |
| | | ,{field: 'units', align: 'center',title: '单箱毛重kg', hide: false} |
| | | // ,{field: 'barcode', align: 'center',title: '条码', hide: true} |
| | | // ,{field: 'origin', align: 'center',title: '在库标记', hide: true} |
| | | ,{field: 'manu', align: 'center',title: '仓库编码', hide: true} |
| | | // ,{field: 'manuDate', align: 'center',title: '生产日期', hide: true} |
| | | // ,{field: 'safeQty', align: 'center',title: '总件数', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '单箱净重kg', hide: false} |
| | | ,{field: 'weight', align: 'center',title: '单箱净重kg', hide: true} |
| | | // ,{field: 'manLength', align: 'center',title: '长(毫米)', hide: false} |
| | | // ,{field: 'width', align: 'center',title: '宽(毫米)', hide: false} |
| | | // ,{field: 'height', align: 'center',title: '高(毫米)', hide: false} |
| | |
| | | success: function (res) { |
| | | layer.closeAll(); |
| | | if (res.code === 200 && res.data && res.data.length > 0) { |
| | | var titles = ['库存数量', '商品编号', '商品名称', '采购单号', '条码UPC', '单箱净重(kg)', '客户PO']; |
| | | var fieldKeys = ['anfme', 'matnr', 'maktx', 'boxType3', 'standby2', 'weight', 'standby1']; |
| | | var titles = ['库存数量', '商品编号', '商品名称', '采购单号', '条码UPC', '单箱毛重(kg)', '客户PO']; |
| | | var fieldKeys = ['anfme', 'matnr', 'maktx', 'boxType3', 'standby2', 'units', 'standby1']; |
| | | |
| | | var exportData = res.data.map(function(item) { |
| | | return [ |
| | |
| | | item.maktx || '', // 如果 maktx 为空可默认 |
| | | item.boxType3 || '', |
| | | item.standby2 || '', |
| | | item.weight || '', |
| | | item.units || '', |
| | | item.standby1 || '' // 如字段是 order_no 改成 item.order_no |
| | | ]; |
| | | }); |
| | |
| | | @size-change="handleDetailSizeChange" |
| | | @current-change="handleDetailCurrentChange" |
| | | :current-page="detailCurrentPage" |
| | | :page-sizes="[5, 10, 20]" |
| | | :page-sizes="[5, 10, 20, 50, 100]" |
| | | :page-size="detailPageSize" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="detailTotal"> |
| | |
| | | // // 模拟数据 |
| | | // that.mockTableBData(); |
| | | // } |
| | | // }); |
| | | // });c |
| | | // }, |
| | | |
| | | // 获取商品唯一标识 |