| | |
| | | package com.ruoyi.common.utils.api; |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | |
| | | * 查询采购订单未检验 |
| | | */ |
| | | public List<Map<String, Object>> getInventory(String inAttr) { |
| | | if (isDisabled()) { |
| | | return java.util.Collections.emptyList(); |
| | | } |
| | | String procedureName = "QUERY_POL_RECEIPT_STD"; |
| | | JSONObject stockMap = getJsonObject(procedureName, inAttr); |
| | | String body = HttpRequest.post(ifsProperties.getCustorderPort()).form(stockMap).execute().body(); |
| | | String body = ""; |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | try { |
| | | Map map = objectMapper.readValue(body, Map.class); |
| | |
| | | return getResult("MODIFY_PURCH_RECEIPT_LOT_STD", inAttr, ifsProperties.getCustorder(), "修改采购订单批次号-->"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 库存物料批次属性新增修改接口 |
| | | * |
| | | * @param inAttr |
| | | * @return |
| | | */ |
| | | public Result importPartLotAttr(String inAttr) { |
| | | return getResult("IMPORT_PART_LOT_ATTR_STD", inAttr, ifsProperties.getCustorder(), "库存物料批次属性新增修改接口-->"); |
| | | } |
| | | |
| | | /** |
| | | * 查询库存数据 |
| | |
| | | * @return |
| | | */ |
| | | public Result getIfsStock(String inAttr) { |
| | | if (isDisabled()) { |
| | | return Result.success(java.util.Collections.singletonMap("LIST_INFO", java.util.Collections.emptyList())); |
| | | } |
| | | return getResult("QUERY_INVENTORY_INFO_STD", inAttr, ifsProperties.getCustorderPort(), "查询库存信息-->"); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | private Result<?> getResult(String procedureName, String inAttr, String url, String image) { |
| | | if (isDisabled()) { |
| | | return Result.success(); |
| | | } |
| | | JSONObject stockMap = new JSONObject(); |
| | | stockMap.put("procedureName", procedureName); |
| | | stockMap.put("contract", ifsProperties.getContract()); |
| | | stockMap.put("contractKey", ifsProperties.getContractKeyPost()); |
| | | stockMap.put("userId", "lims_user"); |
| | | stockMap.put("inAttr", inAttr); |
| | | String body = HttpRequest.post(url).form(stockMap).execute().body(); |
| | | String body = ""; |
| | | log.info(image + body); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | try { |
| | |
| | | stockMap.put("inAttr", inAttr); |
| | | return stockMap; |
| | | } |
| | | |
| | | private boolean isDisabled() { |
| | | return true; |
| | | } |
| | | } |