From b005bd25a5320545e7402173c3c93a7622b59d46 Mon Sep 17 00:00:00 2001 From: erdanergou Date: Mon, 24 Apr 2023 10:37:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9C=AC=E5=9C=B0=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E5=BA=93=E5=AD=98=E5=8F=AF=E8=A7=86=E5=8C=96?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DepositoryController.java | 509 ++++++++++++------ .../impl/DepositoryRecordServiceImpl.java | 6 +- .../pages/application/application-in.html | 3 +- .../pages/chart/chart-in_mobile.html | 3 + .../pages/chart/chart-out_mobile.html | 3 + .../pages/chart/chart-stock_mobile.html | 88 ++- .../material/selectDepositoryByCard.html | 2 - .../resources/templates/pages/user/login.html | 4 +- .../depository_manage/BarChartTest.java | 245 +++++++++ .../InventoryLineChartTest.java | 95 ++-- .../depository_manage/LineChartTest.java | 2 +- .../depository_manage/OtherTest.java | 44 ++ 12 files changed, 769 insertions(+), 235 deletions(-) create mode 100644 src/test/java/com/dreamchaser/depository_manage/BarChartTest.java create mode 100644 src/test/java/com/dreamchaser/depository_manage/OtherTest.java diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java index eca4a84d..845bfeec 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/DepositoryController.java @@ -414,8 +414,7 @@ public class DepositoryController { show_data.putAll((Map) result); } depository_data.put("data", show_data); - } - else{ + } else { // 定义线程 ExecutorService exs = Executors.newFixedThreadPool(depositoryAllNameAndId.size()); // 结果集 @@ -480,9 +479,9 @@ public class DepositoryController { if ("0".equals(type)) { // 如果是获取库存 Map inventoryLineChartData = getInventoryLineChartData(depositoryAllNameAndId); - depository_data.put("data",inventoryLineChartData); + depository_data.put("data", inventoryLineChartData); } else { - Map lineChartData = getLineChartData(depositoryAllNameAndId, type); + Map lineChartData = getLineChartData(depositoryAllNameAndId, type, "line"); depository_data.put("data", lineChartData); } return depository_data; @@ -536,7 +535,9 @@ public class DepositoryController { // 获取库存图 if ("0".equals(type)) { - // 获取库存旭日图 + + + // 获取库存旭日图 Future futureForSunburstData = completionService.submit(new distributeTasks(depositoryAllNameAndId, type, 5, userByPort, depositoryName)); futureList.add(futureForSunburstData); taskNum += 1; @@ -547,6 +548,12 @@ public class DepositoryController { taskNum += 1; + // 出入库对比图数据 + Map barChartData = new HashMap<>(); + // 获取本周出入库对比图数据 + Future futureForBarData = completionService.submit(new distributeTasks(depositoryAllNameAndId, type, 4, userByPort, depositoryName)); + futureList.add(futureForBarData); + taskNum += 1; for (int i = 0; i < taskNum; i++) { @@ -562,11 +569,17 @@ public class DepositoryController { if (lineChartData == null || lineChartData.size() == 0) { lineChartData = (Map) ((Map) result).get("inventoryLineChartData"); } + if (barChartData == null || barChartData.size() == 0) { + barChartData = (Map) ((Map) result).get("barChartData"); + } } + if (barChartData != null && barChartData.size() > 0) { + depository_data.put("barChartData", barChartData); + } - } - else { + + } else { // 获取本周至今仓库的入/出库数量 Future futureForBarChartData = completionService.submit(new distributeTasks(depositoryAllNameAndId, type, 1, userByPort, depositoryName)); @@ -612,7 +625,7 @@ public class DepositoryController { } // 获取面积图图数据 - public Map getLineChartData(Map depositoryAllNameAndId, String type) { + public Map getLineChartData(Map depositoryAllNameAndId, String type, String barOrLine) { // 获取遍历器 Iterator it = depositoryAllNameAndId.keySet().iterator(); @@ -643,8 +656,14 @@ public class DepositoryController { Map show_data = new HashMap<>(); while (it.hasNext()) { Object next = it.next(); - getApplicationRecordByDate getApplicationRecordByDate = new getApplicationRecordByDate(type, next.toString(), days, depositoryAllNameAndId); - Future future = completionService.submit(getApplicationRecordByDate); + Future future; + if ("line".equals(barOrLine)) { + getApplicationRecordByDate getApplicationRecordByDate = new getApplicationRecordByDate(type, next.toString(), days, depositoryAllNameAndId); + future = completionService.submit(getApplicationRecordByDate); + } else { + getBarChartDataForApplicationRecord getApplicationRecordByDate = new getBarChartDataForApplicationRecord(type, next.toString(), days, depositoryAllNameAndId); + future = completionService.submit(getApplicationRecordByDate); + } futureList.add(future); } @@ -660,7 +679,6 @@ public class DepositoryController { return show_data; } - // 用于获取旭日图数据 //获取本月及之前月份各种类别入/出库总量 public List getSunburstChartData(String type) { @@ -693,16 +711,15 @@ public class DepositoryController { } return result; } - - - + // 用于获取旭日图数据 /** * 用于获取当前用户所拥有的仓库库存及各类别的库存 - * @param userByPort 带获取用户 + * + * @param userByPort 带获取用户 * @return */ - public List getInventorySunburstData(UserByPort userByPort){ + public List getInventorySunburstData(UserByPort userByPort) { Map previousMonth = DateUtil.getPreviousMonth(); // 获取所有月份 List months = (List) previousMonth.get("months"); @@ -757,9 +774,9 @@ public class DepositoryController { obj = completionService.take().get(); Map objectMap = (Map) obj; Integer id = ObjectFormatUtil.toInteger((objectMap).get("id")); - List inventoryByMtAndD = (List)objectMap.get("inventoryByMtAndD"); + List inventoryByMtAndD = (List) objectMap.get("inventoryByMtAndD"); value += ObjectFormatUtil.toDouble(objectMap.get("value")); - inventoryForMTAndDepository.put(id,inventoryByMtAndD); + inventoryForMTAndDepository.put(id, inventoryByMtAndD); (objectMap).remove("id"); (objectMap).remove("inventoryByMtAndD"); @@ -770,10 +787,10 @@ public class DepositoryController { e.printStackTrace(); } } - Map stringObjectMap = new HashMap<>(); - stringObjectMap.put("children",childItems); - stringObjectMap.put("name",month); - stringObjectMap.put("value",value); + Map stringObjectMap = new HashMap<>(); + stringObjectMap.put("children", childItems); + stringObjectMap.put("name", month); + stringObjectMap.put("value", value); Random random = new Random(); int r = random.nextInt(256); int g = random.nextInt(256); @@ -786,106 +803,6 @@ public class DepositoryController { return result; } - /** - * 用于计算当前时间段内当前仓库下各物料类型的库存 - */ - class inventoryByMaterialTypeForMonth implements Callable { - - // 开始时间 - Object start; - // 结束时间 - Object end; - // 查询仓库 - Depository depository; - // 当前仓库各物料类型库存数 - List todayInventoryInfoByDidAndMt; - - public inventoryByMaterialTypeForMonth(Object start, Object end, Depository depository, List todayInventoryInfoByDidAndMt) { - this.start = start; - this.end = end; - this.depository = depository; - this.todayInventoryInfoByDidAndMt = todayInventoryInfoByDidAndMt; - } - - @Override - public Object call() throws Exception { - // 定义当前返回结果 - Map result = new HashMap<>(); - // 定义当前仓库的总数 - double inventorySum = 0.0; - for (InventoryByMTAndDepository item : todayInventoryInfoByDidAndMt - ) { - inventorySum += item.getInventory(); - } - result.put("name", depository.getDname()); - result.put("id",depository.getId()); - result.put("value", inventorySum); - // 用于生产随机的颜色 - Random random = new Random(); - int r = random.nextInt(256); - int g = random.nextInt(256); - int b = random.nextInt(256); - Map itemStyle = new HashMap<>(); - itemStyle.put("color", "rgb(" + r + "," + g + "," + b + ")"); - result.put("itemStyle", itemStyle); - - // 获取所有顶级物料类型 - List materialTypeNoParent = materialTypeService.findMaterialTypeNoParent(); - Map paramIn = new HashMap<>(); - Map paramOut = new HashMap<>(); - // 获取每月入库总额 - paramIn.put("type", 1); - paramIn.put("state", "已入库"); - paramIn.put("depository_id", depository.getId()); - paramIn.put("start", start); - paramIn.put("end", end); - // 获取每月出库总额 - paramOut.put("type", 2); - paramOut.put("state", "已出库"); - paramOut.put("depository_id", depository.getId()); - paramOut.put("start", start); - paramOut.put("end", end); - List children = new ArrayList<>(); - for (MaterialType materialType : materialTypeNoParent - ) { - // 生成子数据 - Map resultItem = new HashMap<>(); - resultItem.put("name", materialType.getTname()); - // 用于生产随机的颜色 - Map itemStyleItem = new HashMap<>(); - int rt = random.nextInt(256); - int gt = random.nextInt(256); - int bt = random.nextInt(256); - itemStyleItem.put("color", "rgb(" + rt + "," + gt + "," + bt + ")"); - result.put("itemStyle", itemStyleItem); - long oldId = materialType.getOldId(); - paramIn.put("oldId", oldId); - paramOut.put("oldId", oldId); - // 获取当前类别在当前仓库下当前月份的入库总额 - Double wareHouseInCountByMonth = depositoryRecordService.calMaterialTypeTopCount(paramIn); - // 获取当前类别在当前仓库下当前月份的出库总额 - Double wareHouseOutCountByMonth = depositoryRecordService.calMaterialTypeTopCount(paramOut); - for (InventoryByMTAndDepository item : todayInventoryInfoByDidAndMt - ) { - long mtId = item.getMtId(); - // 如果是同一类型 - if (mtId == oldId) { - // 计算上个月该类型库存数 - Double wareHouseCount = item.getInventory() - wareHouseInCountByMonth + wareHouseOutCountByMonth; - // 修改库存记录 - item.setInventory(wareHouseCount); - resultItem.put("value", wareHouseCount); - } - } - children.add(resultItem); - } - result.put("children", children); - result.put("inventoryByMtAndD",todayInventoryInfoByDidAndMt); - return result; - } - } - - /** * 根据物料编号查询所在仓库 * @@ -1113,7 +1030,6 @@ public class DepositoryController { return new RestResponse(list); } - // 构造库位树 @GetMapping("/treeMenus_Place") public RestResponse InitTreeMenus_Place(@RequestParam(value = "depositoryId") Integer depositoryId) { @@ -1262,7 +1178,6 @@ public class DepositoryController { } } - @PostMapping("/findWarehouseVisiblePermission") public RestResponse findWarehouseVisiblePermission(@RequestBody Map map) { List list = roleService.findDepositoryIdForWarehouseVisiblePermissionByCondition(map); @@ -1309,6 +1224,115 @@ public class DepositoryController { return false; } + /** + * 用于获取出入库对照柱状图 + * + * @param userByPort 待获取的当前用户 + * @return + */ + Map getBarChartData(UserByPort userByPort) { + Map depositoryAllNameAndId = depositoryService.findDepositoryAllNameAndId(userByPort); + ExecutorService exs = Executors.newFixedThreadPool(2); + // 结果集 + List> futureList = new ArrayList>(); + // 定义CompletionService + CompletionService completionService = new ExecutorCompletionService(exs); + Future submitForIn = completionService.submit(new GetBarChartData(depositoryAllNameAndId, "1")); + Future submitForOut = completionService.submit(new GetBarChartData(depositoryAllNameAndId, "2")); + futureList.add(submitForOut); + futureList.add(submitForIn); + Map result = new HashMap<>(); + for (int i = 0; i < 2; i++) { + Object obj = null; + try { + obj = completionService.take().get(); + } catch (InterruptedException | ExecutionException e) { + e.printStackTrace(); + } + result.putAll((Map) obj); + } + return result; + } + + /** + * 获取本周各仓库库存的折线图数据 + * + * @param depositoryAllNameAndId 仓库与Id对应 + * @return + */ + // 获取柱状图数据 + public Map getInventoryLineChartData(Map depositoryAllNameAndId) { + + // 每天各仓库入库数目 + Map show_data = new HashMap<>(); + + // 获取当前各仓库的库存数 + List toDayInventoryByDName = depositoryService.getToDayInventoryByDName(); + // 获取遍历器 + Iterator it = depositoryAllNameAndId.keySet().iterator(); + //获取获取系统的当前日历对象 + Calendar instance = Calendar.getInstance(); + int weekDay = instance.get(Calendar.DAY_OF_WEEK); + weekDay = weekDay - 1; + if (weekDay == 1) { + + while (it.hasNext()) { + String key = it.next().toString(); + Integer val = depositoryAllNameAndId.get(key); + String dname = key.split(",")[0]; + Double inventoryByDname = getInventoryByDname(dname, toDayInventoryByDName); + Map map = new HashMap<>(); + map.put("type", "line"); + Map areaStyleItem = new HashMap<>(); + map.put("areaStyle", areaStyleItem); + List doubleList = new ArrayList<>(); + doubleList.add(inventoryByDname); + map.put("data", doubleList); + show_data.put(val, map); + } + } else { + // 获取日期 + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + int now = instance.get(Calendar.DAY_OF_WEEK) - 1 == 0 ? 7 : instance.get(Calendar.DAY_OF_WEEK) - 1; + List days = new ArrayList<>(); // 周一至今的每天 + instance.add(Calendar.DATE, 1); + days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()))); + instance.add(Calendar.DATE, -1); + days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()))); + while (now - 1 > 0) { + now--; + instance.add(Calendar.DATE, -1); + Long format = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())); + days.add(format); + } + + // 定义线程 + ExecutorService exs = Executors.newFixedThreadPool(depositoryAllNameAndId.size()); + // 结果集 + List> futureList = new ArrayList>(); + // 1.定义CompletionService + CompletionService completionService = new ExecutorCompletionService(exs); + while (it.hasNext()) { + Object next = it.next(); + getInventoryByDate getApplicationRecordByDate = new getInventoryByDate(next.toString(), days, depositoryAllNameAndId, toDayInventoryByDName); + Future future = completionService.submit(getApplicationRecordByDate); + futureList.add(future); + } + + for (int i = 0; i < depositoryAllNameAndId.size(); i++) { + Object result = null; + try { + result = completionService.take().get(); + } catch (InterruptedException | ExecutionException e) { + e.printStackTrace(); + } + show_data.putAll((Map) result); + } + } + + + return show_data; + } // 用于分发任务 @Data @@ -1334,12 +1358,12 @@ public class DepositoryController { @Override public Object call() throws Exception { - // taskType 1为条形图2为旭日图3为库存可视化中的本周折线图4为库存可视化中上周折线图图5为库存可视化中的旭日图 + // taskType 1为条形图2为旭日图3为库存可视化中的本周折线图4为库存可视化中出库入库对比图图5为库存可视化中的旭日图 Map result = new HashMap<>(); if (1 == taskType) { // 获取入库 - Map lineChartData = getLineChartData(depositoryAllNameAndId, type); + Map lineChartData = getLineChartData(depositoryAllNameAndId, type, "line"); result.put("lineChartData", lineChartData); } else if (2 == taskType) { List sunburstChartData = getSunburstChartData(type); @@ -1348,15 +1372,116 @@ public class DepositoryController { Map inventoryLineChartData = getInventoryLineChartData(depositoryAllNameAndId); result.put("inventoryLineChartData", inventoryLineChartData); } else if (4 == taskType) { - - }else if(5 == taskType){ + Map barChartData = getBarChartData(userByPort); + result.put("barChartData", barChartData); + } else if (5 == taskType) { List inventorySunburstData = getInventorySunburstData(userByPort); - result.put("sunburstChartDataForInventory",inventorySunburstData); + result.put("sunburstChartDataForInventory", inventorySunburstData); + } + return result; + } + } + + /** + * 用于计算当前时间段内当前仓库下各物料类型的库存 + */ + class inventoryByMaterialTypeForMonth implements Callable { + + // 开始时间 + Object start; + // 结束时间 + Object end; + // 查询仓库 + Depository depository; + // 当前仓库各物料类型库存数 + List todayInventoryInfoByDidAndMt; + + public inventoryByMaterialTypeForMonth(Object start, Object end, Depository depository, List todayInventoryInfoByDidAndMt) { + this.start = start; + this.end = end; + this.depository = depository; + this.todayInventoryInfoByDidAndMt = todayInventoryInfoByDidAndMt; + } + + @Override + public Object call() throws Exception { + // 定义当前返回结果 + Map result = new HashMap<>(); + // 定义当前仓库的总数 + double inventorySum = 0.0; + for (InventoryByMTAndDepository item : todayInventoryInfoByDidAndMt + ) { + inventorySum += item.getInventory(); + } + result.put("name", depository.getDname()); + result.put("id", depository.getId()); + result.put("value", inventorySum); + // 用于生产随机的颜色 + Random random = new Random(); + int r = random.nextInt(256); + int g = random.nextInt(256); + int b = random.nextInt(256); + Map itemStyle = new HashMap<>(); + itemStyle.put("color", "rgb(" + r + "," + g + "," + b + ")"); + result.put("itemStyle", itemStyle); + + // 获取所有顶级物料类型 + List materialTypeNoParent = materialTypeService.findMaterialTypeNoParent(); + Map paramIn = new HashMap<>(); + Map paramOut = new HashMap<>(); + // 获取每月入库总额 + paramIn.put("type", 1); + paramIn.put("state", "已入库"); + paramIn.put("depository_id", depository.getId()); + paramIn.put("start", start); + paramIn.put("end", end); + // 获取每月出库总额 + paramOut.put("type", 2); + paramOut.put("state", "已出库"); + paramOut.put("depository_id", depository.getId()); + paramOut.put("start", start); + paramOut.put("end", end); + List children = new ArrayList<>(); + for (MaterialType materialType : materialTypeNoParent + ) { + // 生成子数据 + Map resultItem = new HashMap<>(); + resultItem.put("name", materialType.getTname()); + // 用于生产随机的颜色 + Map itemStyleItem = new HashMap<>(); + int rt = random.nextInt(256); + int gt = random.nextInt(256); + int bt = random.nextInt(256); + itemStyleItem.put("color", "rgb(" + rt + "," + gt + "," + bt + ")"); + result.put("itemStyle", itemStyleItem); + long oldId = materialType.getOldId(); + paramIn.put("oldId", oldId); + paramOut.put("oldId", oldId); + // 获取当前类别在当前仓库下当前月份的入库总额 + Double wareHouseInCountByMonth = depositoryRecordService.calMaterialTypeTopCount(paramIn); + // 获取当前类别在当前仓库下当前月份的出库总额 + Double wareHouseOutCountByMonth = depositoryRecordService.calMaterialTypeTopCount(paramOut); + for (InventoryByMTAndDepository item : todayInventoryInfoByDidAndMt + ) { + long mtId = item.getMtId(); + // 如果是同一类型 + if (mtId == oldId) { + // 计算上个月该类型库存数 + Double wareHouseCount = item.getInventory() - wareHouseInCountByMonth + wareHouseOutCountByMonth; + // 修改库存记录 + item.setInventory(wareHouseCount); + resultItem.put("value", wareHouseCount); + } + } + children.add(resultItem); } + result.put("children", children); + result.put("inventoryByMtAndD", todayInventoryInfoByDidAndMt); return result; } } + /** * 根据日期获取出入库的数量 */ @@ -1389,7 +1514,7 @@ public class DepositoryController { for (i = days.size() - 1; i > 0; i--) { // 遍历 Map并计算各仓库的入库数 // 获取一段时间内的库存额度 - Double depositoryRecordByDate1 = depositoryRecordService.findApplicationRecordByDate(days.get(i), days.get(i - 1), Integer.parseInt(type), val); + Double depositoryRecordByDate1 = depositoryRecordService.findApplicationRecordByDate(days.get(i - 1), days.get(i), Integer.parseInt(type), val); drCountbyDrName.add(depositoryRecordByDate1); } map.put("data", drCountbyDrName); @@ -1398,64 +1523,92 @@ public class DepositoryController { } } - /** - * 获取本周各仓库库存的折线图数据 - * @param depositoryAllNameAndId 仓库与Id对应 - * @return + * 用于执行柱状图线程 */ - // 获取柱状图数据 - public Map getInventoryLineChartData(Map depositoryAllNameAndId) { + class GetBarChartData implements Callable { - // 获取遍历器 - Iterator it = depositoryAllNameAndId.keySet().iterator(); - //获取获取系统的当前日历对象 - Calendar instance = Calendar.getInstance(); - // 获取日期 - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); - int now = instance.get(Calendar.DAY_OF_WEEK) - 1 == 0 ? 7 : instance.get(Calendar.DAY_OF_WEEK) - 1; - List days = new ArrayList<>(); // 周一至今的每天 - instance.add(Calendar.DATE, 1); - days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()))); - instance.add(Calendar.DATE, -1); - days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()))); - while (now - 1 > 0) { - now--; - instance.add(Calendar.DATE, -1); - Long format = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())); - days.add(format); - } - // 获取当前各仓库的库存数 - List toDayInventoryByDName = depositoryService.getToDayInventoryByDName(); - // 定义线程 - ExecutorService exs = Executors.newFixedThreadPool(depositoryAllNameAndId.size()); - // 结果集 - List> futureList = new ArrayList>(); - // 1.定义CompletionService - CompletionService completionService = new ExecutorCompletionService(exs); + // 仓库名称与id对应 + Map depositoryAllNameAndId; + // 要查询的类型 + String type; - // 每天各仓库库存数目 - Map show_data = new HashMap<>(); - while (it.hasNext()) { - Object next = it.next(); - getInventoryByDate getApplicationRecordByDate = new getInventoryByDate(next.toString(), days, depositoryAllNameAndId, toDayInventoryByDName); - Future future = completionService.submit(getApplicationRecordByDate); - futureList.add(future); + public GetBarChartData(Map depositoryAllNameAndId, String type) { + this.depositoryAllNameAndId = depositoryAllNameAndId; + this.type = type; } - for (int i = 0; i < depositoryAllNameAndId.size(); i++) { - Object result = null; - try { - result = completionService.take().get(); - } catch (InterruptedException | ExecutionException e) { - e.printStackTrace(); + @Override + public Object call() throws Exception { + Map lineChartData = getLineChartData(depositoryAllNameAndId, type, "bar"); + Map result = new HashMap<>(); + if ("1".equals(type)) { + // 如果是入库 + result.put("in", lineChartData); + } else if ("2".equals(type)) { + // 如果是出库 + result.put("out", lineChartData); } - show_data.putAll((Map) result); + return result; } - - return show_data; } + /** + * 根据日期获取出入库的数量(用于柱状图) + */ + @Data + class getBarChartDataForApplicationRecord implements Callable { + String key; + List days; + Map depositoryAllNameAndId; + + + String type; + + + getBarChartDataForApplicationRecord(String type, String key, List days, Map depositoryAllNameAndId) { + this.key = key; + this.depositoryAllNameAndId = depositoryAllNameAndId; + this.days = days; + this.type = type; + } + + @Override + public Object call() throws Exception { + + Map result = new HashMap<>(); + Map map = new HashMap<>(); + map.put("type", "bar"); + Map emphasisItem = new HashMap<>(); + emphasisItem.put("focus", "series"); + map.put("emphasis", emphasisItem); + Map labelItem = new HashMap<>(); + labelItem.put("show", true); + labelItem.put("position", "inside"); + map.put("label", labelItem); + if ("1".equals(type)) { + map.put("name", "入库"); + } else { + map.put("name", "出库"); + } + int i; + List drCountbyDrName = new ArrayList<>(); + + Integer val = depositoryAllNameAndId.get(key); + for (i = days.size() - 1; i > 0; i--) { + // 遍历 Map并计算各仓库的入库数 + // 获取一段时间内的库存额度 + Double depositoryRecordByDate1 = depositoryRecordService.findApplicationRecordByDate(days.get(i - 1), days.get(i), Integer.parseInt(type), val); + if ("2".equals(type)) { + depositoryRecordByDate1 = -depositoryRecordByDate1; + } + drCountbyDrName.add(depositoryRecordByDate1); + } + map.put("data", drCountbyDrName); + result.put(val, map); + return result; + } + } /** * 根据日期获取各仓库库存的数量 diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java index 40cbd80a..c7274f53 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java @@ -564,7 +564,7 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { e.printStackTrace(); } countForToday += ObjectFormatUtil.toDouble(((Map) o).get("count")); - priceForToday += Double.parseDouble(((Map) o).get("price").toString()); + priceForToday += ObjectFormatUtil.toDouble(((Map) o).get("price")); } } if (yesterdaySize > 0) { @@ -590,8 +590,8 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { } catch (ExecutionException e) { e.printStackTrace(); } - countForYesterday += ObjectFormatUtil.toInteger(((Map) o).get("count")); - priceForYesterday += Double.parseDouble(((Map) o).get("price").toString()); + countForYesterday += ObjectFormatUtil.toDouble(((Map) o).get("count")); + priceForYesterday += ObjectFormatUtil.toDouble(((Map) o).get("price")); } } // 设置今天的额度 diff --git a/src/main/resources/templates/pages/application/application-in.html b/src/main/resources/templates/pages/application/application-in.html index 54a0b848..d36a04d3 100644 --- a/src/main/resources/templates/pages/application/application-in.html +++ b/src/main/resources/templates/pages/application/application-in.html @@ -728,14 +728,13 @@ contentType: "application/json;charset=utf-8", success: function (d) { var d = d.data; - console.log(materialId) var idNumber = materialId.name.split("mid")[1]; if (d == null) { layer.msg("没有该编码,请确认是否输入正确", { icon: 0, time: 500 }, function () { - layer.close(loading2) + layer.close(loading2); materialName.value = ""; materialId.value = ""; obj.value = ""; diff --git a/src/main/resources/templates/pages/chart/chart-in_mobile.html b/src/main/resources/templates/pages/chart/chart-in_mobile.html index 5f111cc4..2a00528b 100644 --- a/src/main/resources/templates/pages/chart/chart-in_mobile.html +++ b/src/main/resources/templates/pages/chart/chart-in_mobile.html @@ -191,6 +191,9 @@ yAxis: { type: 'value' }, + tooltip:{ + trigger:"axis", + }, series: [] }; diff --git a/src/main/resources/templates/pages/chart/chart-out_mobile.html b/src/main/resources/templates/pages/chart/chart-out_mobile.html index 6278ad1e..11bdfa5f 100644 --- a/src/main/resources/templates/pages/chart/chart-out_mobile.html +++ b/src/main/resources/templates/pages/chart/chart-out_mobile.html @@ -189,6 +189,9 @@ yAxis: { type: 'value' }, + tooltip:{ + trigger:"axis", + }, series: [] }; diff --git a/src/main/resources/templates/pages/chart/chart-stock_mobile.html b/src/main/resources/templates/pages/chart/chart-stock_mobile.html index a04ea224..5c4437c4 100644 --- a/src/main/resources/templates/pages/chart/chart-stock_mobile.html +++ b/src/main/resources/templates/pages/chart/chart-stock_mobile.html @@ -46,7 +46,7 @@ -
@@ -61,6 +61,17 @@
+
+

出入库对比

+
+ +
+
+
+ + @@ -133,8 +144,10 @@ let LineChartData = {}; + let inBarChartData = {}; + let outBarChartData = {}; - // 柱状图 + // 面积图 var echartLineChart = echarts.init(document.getElementById('echarts-line')); var optionLineChart = { xAxis: { @@ -145,11 +158,47 @@ yAxis: { type: 'value' }, + tooltip:{ + trigger:"axis", + }, series: [] }; - + // 柱状图 + var echartBarChart = echarts.init(document.getElementById('echarts-bar-chart')); + var optionBarChart = { + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'shadow' + } + }, + legend: { + data: [] + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + xAxis: [ + { + type: 'value' + } + ], + yAxis: [ + { + type: 'category', + axisTick: { + show: false + }, + data: [] + } + ], + series: [] + }; //动态加载相关数据 $.ajax({ @@ -175,18 +224,31 @@ let keys = Object.keys(depositoryItem); for (let i = 0; i < keys.length; i++) { let key = keys[i]; - $("#selectDepositoryForChart").append(new Option(key,depositoryItem[key])); + $("#selectDepositoryForLineChart").append(new Option(key, depositoryItem[key])); + $("#selectDepositoryForBarChart").append(new Option(key, depositoryItem[key])); } + let depositoryKey = depositoryItem[keys[0]]; + let week = data.depository_data.week; - optionSunburstChart.series.data =data.depository_data.sunburstChartData; + + optionSunburstChart.series.data = data.depository_data.sunburstChartData; echartSunburstChart.setOption(optionSunburstChart); LineChartData = data.depository_data.lineChartData; - optionLineChart.series = LineChartData[depositoryItem[keys[0]]]; - optionLineChart.xAxis.data = data.depository_data.week; + optionLineChart.series = LineChartData[depositoryKey]; + optionLineChart.xAxis.data = week; echartLineChart.setOption(optionLineChart); + + + + optionBarChart.legend.data = ["入库","出库"]; + optionBarChart.yAxis[0].data = week; + inBarChartData = data.depository_data.barChartData["in"]; + outBarChartData = data.depository_data.barChartData["out"]; + optionBarChart.series=[inBarChartData[depositoryKey],outBarChartData[depositoryKey]]; + echartBarChart.setOption(optionBarChart) } } @@ -210,7 +272,7 @@ success: function (result) { layer.close(this.layerIndex); LineChartData = result.data; - let value = $("#selectDepositoryForChart").val(); + let value = $("#selectDepositoryForLineChart").val(); optionLineChart.series = LineChartData[value]; echartLineChart.setOption(optionLineChart); } @@ -234,20 +296,26 @@ success: function (result) { layer.close(this.layerIndex); LineChartData = result.data; - let value = $("#selectDepositoryForChart").val(); + let value = $("#selectDepositoryForLineChart").val(); optionLineChart.series = LineChartData[value]; echartLineChart.setOption(optionLineChart); } }) }); - $('#selectDepositoryForChart').on('change', function (obj) { + $('#selectDepositoryForLineChart').on('change', function (obj) { let value = obj.target.value; optionLineChart.series = LineChartData[value]; echartLineChart.setOption(optionLineChart); }); + $('#selectDepositoryForBarChart').on('change', function (obj) { + let value = obj.target.value; + optionBarChart.series=[inBarChartData[value],outBarChartData[value]]; + echartBarChart.setOption(optionBarChart); + }); + }); diff --git a/src/main/resources/templates/pages/material/selectDepositoryByCard.html b/src/main/resources/templates/pages/material/selectDepositoryByCard.html index 2305cdff..bcb2aca5 100644 --- a/src/main/resources/templates/pages/material/selectDepositoryByCard.html +++ b/src/main/resources/templates/pages/material/selectDepositoryByCard.html @@ -53,8 +53,6 @@ // 物料查询跳转入库 depositoryChildren = windowParent.childNodes[15]; } - console.log(windowParent.childNodes) - console.log(depositoryChildren) }else{ depositoryChildren = windowParent.childNodes[11]; } diff --git a/src/main/resources/templates/pages/user/login.html b/src/main/resources/templates/pages/user/login.html index 0f7a5112..d65bb3c4 100644 --- a/src/main/resources/templates/pages/user/login.html +++ b/src/main/resources/templates/pages/user/login.html @@ -298,9 +298,7 @@ $("#login_panle").hide(); }) - $('body').on('click', '[data-refresh]', function () { - location.reload(); - }) + // 卸载 diff --git a/src/test/java/com/dreamchaser/depository_manage/BarChartTest.java b/src/test/java/com/dreamchaser/depository_manage/BarChartTest.java new file mode 100644 index 00000000..a47e58e0 --- /dev/null +++ b/src/test/java/com/dreamchaser/depository_manage/BarChartTest.java @@ -0,0 +1,245 @@ +package com.dreamchaser.depository_manage; + +import com.alibaba.fastjson.JSONObject; +import com.dreamchaser.depository_manage.entity.UserByPort; +import com.dreamchaser.depository_manage.service.DepositoryRecordService; +import com.dreamchaser.depository_manage.service.DepositoryService; +import com.dreamchaser.depository_manage.service.MaterialService; +import com.dreamchaser.depository_manage.service.MaterialTypeService; +import com.dreamchaser.depository_manage.utils.DateUtil; +import com.dreamchaser.depository_manage.utils.LinkInterfaceUtil; +import lombok.Data; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.concurrent.*; + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@RunWith(SpringRunner.class) +public class BarChartTest { + + + @Autowired + MaterialTypeService materialTypeService; + + @Autowired + DepositoryRecordService depositoryRecordService; + + @Autowired + MaterialService materialService; + + @Autowired + DepositoryService depositoryService; + + /** + * 获取本月之前的月份 + * + * @return + */ + public static Map getPreviousMonth() { + Calendar instance = Calendar.getInstance(); + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM"); + Map source = new HashMap<>(); + List sourceList = new ArrayList<>(); + int month = instance.get(Calendar.MONTH) + 1; + // 获取下个月 + instance.add(Calendar.MONTH, 1); + Long nextMonth = DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime())); + ArrayList months = new ArrayList<>(); + months.add(nextMonth); + instance.add(Calendar.MONTH, -1); + + while (month > 0) { + instance.set(Calendar.MONTH, month); + instance.set(Calendar.DAY_OF_MONTH, -1); + source.put("month", month + "月"); + months.add(DateUtil.DateTimeByMonthToTimeStamp(formatter.format(instance.getTime()))); + month--; + sourceList.add(((HashMap) source).clone()); + } + instance.set(Calendar.MONTH, month); + instance.add(Calendar.MONTH, 1); + Map map = new HashMap<>(); + map.put("months", months); + map.put("sourceList", sourceList); + return map; + } + + @Test + public void main() { + UserByPort userByPort = LinkInterfaceUtil.FindUserById(87, null); + + } + + + /** + * 用于获取出入库对照柱状图 + * @param userByPort 待获取的当前用户 + * @return + */ + List getBarChartData( UserByPort userByPort){ + Map depositoryAllNameAndId = depositoryService.findDepositoryAllNameAndId(userByPort); + ExecutorService exs = Executors.newFixedThreadPool(2); + // 结果集 + List> futureList = new ArrayList>(); + // 定义CompletionService + CompletionService completionService = new ExecutorCompletionService(exs); + Future submitForIn = completionService.submit(new GetBarChartData(depositoryAllNameAndId, "1")); + Future submitForOut = completionService.submit(new GetBarChartData(depositoryAllNameAndId, "2")); + futureList.add(submitForOut); + futureList.add(submitForIn); + List result = new ArrayList<>(); + for (int i = 0; i < 2; i++) { + Object obj = null; + try { + obj = completionService.take().get(); + } catch (InterruptedException | ExecutionException e) { + e.printStackTrace(); + } + result.add(obj); + } + return result; + } + + /** + * 用于执行柱状图线程 + */ + class GetBarChartData implements Callable { + + // 仓库名称与id对应 + Map depositoryAllNameAndId; + // 要查询的类型 + String type; + + public GetBarChartData(Map depositoryAllNameAndId, String type) { + this.depositoryAllNameAndId = depositoryAllNameAndId; + this.type = type; + } + + @Override + public Object call() throws Exception { + Map lineChartData = getLineChartData(depositoryAllNameAndId, type); + Map result = new HashMap<>(); + if("1".equals(type)){ + // 如果是入库 + result.put("in",lineChartData); + }else if("2".equals(type)){ + // 如果是出库 + result.put("out",lineChartData); + } + return result; + } + } + + + /** + * 获取入库或出库数据 + * @param depositoryAllNameAndId 仓库名称与id对应 + * @param type 类型(1入库2出库) + * @return + */ + public Map getLineChartData(Map depositoryAllNameAndId, String type) { + + // 获取遍历器 + Iterator it = depositoryAllNameAndId.keySet().iterator(); + //获取获取系统的当前日历对象 + Calendar instance = Calendar.getInstance(); + // 获取日期 + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + int now = instance.get(Calendar.DAY_OF_WEEK) - 1 == 0 ? 7 : instance.get(Calendar.DAY_OF_WEEK) - 1; + List days = new ArrayList<>(); // 周一至今的每天 + instance.add(Calendar.DATE, 1); + days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()))); + instance.add(Calendar.DATE, -1); + days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()))); + while (now - 1 > 0) { + now--; + instance.add(Calendar.DATE, -1); + Long format = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())); + days.add(format); + } + // 定义线程 + ExecutorService exs = Executors.newFixedThreadPool(depositoryAllNameAndId.size()); + // 结果集 + List> futureList = new ArrayList>(); + // 1.定义CompletionService + CompletionService completionService = new ExecutorCompletionService(exs); + + // 每天各仓库入库数目 + Map show_data = new HashMap<>(); + while (it.hasNext()) { + Object next = it.next(); + getBarChartDataForApplicationRecord getApplicationRecordByDate = new getBarChartDataForApplicationRecord(type, next.toString(), days, depositoryAllNameAndId); + Future future = completionService.submit(getApplicationRecordByDate); + futureList.add(future); + } + + for (int i = 0; i < depositoryAllNameAndId.size(); i++) { + Object result = null; + try { + result = completionService.take().get(); + } catch (InterruptedException | ExecutionException e) { + e.printStackTrace(); + } + show_data.putAll((Map) result); + } + + return show_data; + } + + /** + * 根据日期获取出入库的数量(用于柱状图) + */ + @Data + class getBarChartDataForApplicationRecord implements Callable { + String key; + List days; + Map depositoryAllNameAndId; + + + String type; + + + getBarChartDataForApplicationRecord(String type, String key, List days, Map depositoryAllNameAndId) { + this.key = key; + this.depositoryAllNameAndId = depositoryAllNameAndId; + this.days = days; + this.type = type; + } + + @Override + public Object call() throws Exception { + Map result = new HashMap<>(); + Map map = new HashMap<>(); + map.put("type", "bar"); + Map emphasisItem = new HashMap<>(); + emphasisItem.put("focus","series"); + map.put("emphasis", emphasisItem); + Map labelItem = new HashMap<>(); + labelItem.put("show",true); + labelItem.put("position","inside"); + map.put("label", labelItem); + int i; + List drCountbyDrName = new ArrayList<>(); + + Integer val = depositoryAllNameAndId.get(key); + for (i = days.size() - 1; i > 0; i--) { + // 遍历 Map并计算各仓库的入库数 + // 获取一段时间内的库存额度 + Double depositoryRecordByDate1 = depositoryRecordService.findApplicationRecordByDate(days.get(i - 1), days.get(i), Integer.parseInt(type), val); + if("2".equals(type)){ + depositoryRecordByDate1 = -depositoryRecordByDate1; + } + drCountbyDrName.add(depositoryRecordByDate1); + } + map.put("data", drCountbyDrName); + result.put(val,map); + return result; + } + } +} diff --git a/src/test/java/com/dreamchaser/depository_manage/InventoryLineChartTest.java b/src/test/java/com/dreamchaser/depository_manage/InventoryLineChartTest.java index f61814ca..3ce8408d 100644 --- a/src/test/java/com/dreamchaser/depository_manage/InventoryLineChartTest.java +++ b/src/test/java/com/dreamchaser/depository_manage/InventoryLineChartTest.java @@ -81,52 +81,75 @@ public class InventoryLineChartTest { // 获取柱状图数据 public Map getInventoryLineChartData(Map depositoryAllNameAndId) { + // 每天各仓库入库数目 + Map show_data = new HashMap<>(); + + // 获取当前各仓库的库存数 + List toDayInventoryByDName = depositoryService.getToDayInventoryByDName(); // 获取遍历器 Iterator it = depositoryAllNameAndId.keySet().iterator(); //获取获取系统的当前日历对象 Calendar instance = Calendar.getInstance(); - // 获取日期 - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); - int now = instance.get(Calendar.DAY_OF_WEEK) - 1 == 0 ? 7 : instance.get(Calendar.DAY_OF_WEEK) - 1; - List days = new ArrayList<>(); // 周一至今的每天 - instance.add(Calendar.DATE, 1); - days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()))); - instance.add(Calendar.DATE, -1); - days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()))); - while (now - 1 > 0) { - now--; + int weekDay = instance.get(Calendar.DAY_OF_WEEK); + weekDay = weekDay - 1; + if (weekDay == 1) { + while (it.hasNext()) { + List objectList = new ArrayList<>(); + String key = it.next().toString(); + String dname = key.split(",")[0]; + Double inventoryByDname = getInventoryByDname(dname, toDayInventoryByDName); + Map map = new HashMap<>(); + map.put("type", "line"); + Map areaStyleItem = new HashMap<>(); + map.put("areaStyle", areaStyleItem); + List doubleList = new ArrayList<>(); + doubleList.add(inventoryByDname); + map.put("data", doubleList); + objectList.add(map); + show_data.put(key,objectList); + } + }else{ + // 获取日期 + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); + int now = instance.get(Calendar.DAY_OF_WEEK) - 1 == 0 ? 7 : instance.get(Calendar.DAY_OF_WEEK) - 1; + List days = new ArrayList<>(); // 周一至今的每天 + instance.add(Calendar.DATE, 1); + days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()))); instance.add(Calendar.DATE, -1); - Long format = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())); - days.add(format); - } - // 获取当前各仓库的库存数 - List toDayInventoryByDName = depositoryService.getToDayInventoryByDName(); - // 定义线程 - ExecutorService exs = Executors.newFixedThreadPool(depositoryAllNameAndId.size()); - // 结果集 - List> futureList = new ArrayList>(); - // 1.定义CompletionService - CompletionService completionService = new ExecutorCompletionService(exs); + days.add(DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime()))); + while (now - 1 > 0) { + now--; + instance.add(Calendar.DATE, -1); + Long format = DateUtil.DateTimeByDayToTimeStamp(formatter.format(instance.getTime())); + days.add(format); + } - // 每天各仓库入库数目 - Map show_data = new HashMap<>(); - while (it.hasNext()) { - Object next = it.next(); - getInventoryByDate getApplicationRecordByDate = new getInventoryByDate(next.toString(), days, depositoryAllNameAndId, toDayInventoryByDName); - Future future = completionService.submit(getApplicationRecordByDate); - futureList.add(future); - } + // 定义线程 + ExecutorService exs = Executors.newFixedThreadPool(depositoryAllNameAndId.size()); + // 结果集 + List> futureList = new ArrayList>(); + // 1.定义CompletionService + CompletionService completionService = new ExecutorCompletionService(exs); + while (it.hasNext()) { + Object next = it.next(); + getInventoryByDate getApplicationRecordByDate = new getInventoryByDate(next.toString(), days, depositoryAllNameAndId, toDayInventoryByDName); + Future future = completionService.submit(getApplicationRecordByDate); + futureList.add(future); + } - for (int i = 0; i < depositoryAllNameAndId.size(); i++) { - Object result = null; - try { - result = completionService.take().get(); - } catch (InterruptedException | ExecutionException e) { - e.printStackTrace(); + for (int i = 0; i < depositoryAllNameAndId.size(); i++) { + Object result = null; + try { + result = completionService.take().get(); + } catch (InterruptedException | ExecutionException e) { + e.printStackTrace(); + } + show_data.putAll((Map) result); } - show_data.putAll((Map) result); } + + return show_data; } diff --git a/src/test/java/com/dreamchaser/depository_manage/LineChartTest.java b/src/test/java/com/dreamchaser/depository_manage/LineChartTest.java index a6ec262c..41f1418a 100644 --- a/src/test/java/com/dreamchaser/depository_manage/LineChartTest.java +++ b/src/test/java/com/dreamchaser/depository_manage/LineChartTest.java @@ -74,7 +74,7 @@ public class LineChartTest { @Test public void main() { - UserByPort userByPort = LinkInterfaceUtil.FindUserById(1257, null); + UserByPort userByPort = LinkInterfaceUtil.FindUserById(87, null); Map depositoryAllNameAndId = depositoryService.findDepositoryAllNameAndId(userByPort); Map barChartData = getBarChartData(depositoryAllNameAndId, "1"); System.out.println(JSONObject.toJSONString(barChartData)); diff --git a/src/test/java/com/dreamchaser/depository_manage/OtherTest.java b/src/test/java/com/dreamchaser/depository_manage/OtherTest.java new file mode 100644 index 00000000..2edfe6b7 --- /dev/null +++ b/src/test/java/com/dreamchaser/depository_manage/OtherTest.java @@ -0,0 +1,44 @@ +package com.dreamchaser.depository_manage; + +import com.alibaba.fastjson.JSONObject; +import com.dreamchaser.depository_manage.config.QyWx_approval_template.Approval_template_approver; +import com.dreamchaser.depository_manage.entity.UserByPort; +import com.dreamchaser.depository_manage.pojo.callBackXml.approvalCallBackXml.ApprovalInfo_Details; +import com.dreamchaser.depository_manage.pojo.callBackXml.approvalCallBackXml.ApprovalInfo_Details_Approver; +import com.dreamchaser.depository_manage.service.DepositoryRecordService; +import com.dreamchaser.depository_manage.service.DepositoryService; +import com.dreamchaser.depository_manage.service.MaterialService; +import com.dreamchaser.depository_manage.service.MaterialTypeService; +import com.dreamchaser.depository_manage.utils.DateUtil; +import com.dreamchaser.depository_manage.utils.LinkInterfaceUtil; +import lombok.Data; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.concurrent.*; + +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@RunWith(SpringRunner.class) +public class OtherTest { + + @Autowired + DepositoryRecordService depositoryRecordService; + + + + @Test + public void main() { + UserByPort userByPort = LinkInterfaceUtil.FindUserById(87, null); + ApprovalInfo_Details approvalInfo = new ApprovalInfo_Details(); + ApprovalInfo_Details_Approver approver = new ApprovalInfo_Details_Approver(); + approver.setUserId("PangFuZhen"); + approvalInfo.setApprover(approver); + depositoryRecordService.reviewByQyWxApprovalIn("[8]",approvalInfo,"42156e781cdc727e7d5deac872be45a9","2","202304240010"); + } + +}