From 48507ebd3ae411fe16c7565a8bc418a2c3a80d36 Mon Sep 17 00:00:00 2001 From: bgy <1322446236@qq.com> Date: Fri, 23 Aug 2024 11:43:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BB=93=E6=9E=84=E6=A0=91?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=EF=BC=8C=E6=B3=A8=E9=87=8A=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yml | 13 +++++++++---- .../controller/AppSceneCostCountController.java | 10 +++++----- .../controller/AppSceneCostHourRateController.java | 12 ++++++------ .../AppSceneCostMaterialBomController.java | 12 ++++++------ ...AppSceneCostMaterialProcessHoursController.java | 12 ++++++------ .../AppSceneCostPartMissingInfoController.java | 12 ++++++------ .../AppSceneCostPurchaseEvaluateController.java | 12 ++++++------ .../AppSceneCostPurchasePriceController.java | 12 ++++++------ .../AppSceneCostResultValueController.java | 4 ++-- .../AppSceneCostStandardDetailController.java | 12 ++++++------ .../AppSceneCostStandardVersionController.java | 12 ++++++------ .../service/impl/AppSceneCostCountServiceImpl.java | 2 ++ .../manage/service/impl/BomTreeServiceImpl.java | 14 +++++++------- .../qomo/kn/cost/manage/util/BomTreeBuilder.java | 12 +++++++++++- 14 files changed, 84 insertions(+), 67 deletions(-) diff --git a/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml b/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml index ac280f8..18a44f0 100644 --- a/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml +++ b/qomo-kn-cost-manage-start/src/main/resources/application-dev.yml @@ -15,7 +15,7 @@ v2: defaultFormat: .png server: - port: 8082 + port: 8098 tomcat: max-swallow-size: -1 error: @@ -205,10 +205,15 @@ spring: # 通过connectProperties属性来打开mergeSql功能;慢SQL记录 connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 datasource: +# master: +# url: jdbc:mysql://192.168.50.9:2212/selef_report?useUnicode=true&allowMultiQueries=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useSSL=false +# username: zzzz +# password: knphm2021 +# driver-class-name: com.mysql.cj.jdbc.Driver master: - url: jdbc:mysql://192.168.50.9:2212/selef_report?useUnicode=true&allowMultiQueries=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useSSL=false - username: zzzz - password: knphm2021 + url: jdbc:mysql://158.158.4.51:13306/kn_otd_app?useUnicode=true&allowMultiQueries=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useSSL=false + username: knotd + password: otd@2024 driver-class-name: com.mysql.cj.jdbc.Driver # 多数据源配置 #multi-datasource1: diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java index 9616664..6c021b0 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java @@ -79,7 +79,7 @@ public class AppSceneCostCountController extends JeecgController addCostCountTask(@RequestBody AppSceneCostCount appSceneCostCount) { appSceneCostCountService.addCostCountTask(appSceneCostCount); @@ -95,7 +95,7 @@ public class AppSceneCostCountController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { appSceneCostCountService.removeById(id); @@ -110,7 +110,7 @@ public class AppSceneCostCountController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { // this.appSceneCostCountService.removeByIds(Arrays.asList(ids.split(","))); @@ -157,7 +157,7 @@ public class AppSceneCostCountController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, AppSceneCostCount.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostHourRateController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostHourRateController.java index 8cd1407..0d343b1 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostHourRateController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostHourRateController.java @@ -65,7 +65,7 @@ public class AppSceneCostHourRateController extends JeecgController add(@RequestBody AppSceneCostHourRate appSceneCostHourRate) { appSceneCostHourRateService.save(appSceneCostHourRate); @@ -80,7 +80,7 @@ public class AppSceneCostHourRateController extends JeecgController edit(@RequestBody AppSceneCostHourRate appSceneCostHourRate) { appSceneCostHourRateService.updateById(appSceneCostHourRate); @@ -95,7 +95,7 @@ public class AppSceneCostHourRateController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { appSceneCostHourRateService.removeById(id); @@ -110,7 +110,7 @@ public class AppSceneCostHourRateController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { // this.appSceneCostHourRateService.removeByIds(Arrays.asList(ids.split(","))); @@ -140,7 +140,7 @@ public class AppSceneCostHourRateController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { // return super.importExcel(request, response, AppSceneCostHourRate.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialBomController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialBomController.java index a2018ac..6cc8480 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialBomController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialBomController.java @@ -93,7 +93,7 @@ public class AppSceneCostMaterialBomController extends JeecgController add(@RequestBody AppSceneCostMaterialBom appSceneCostMaterialBom) { // appSceneCostMaterialBomService.save(appSceneCostMaterialBom); @@ -108,7 +108,7 @@ public class AppSceneCostMaterialBomController extends JeecgController edit(@RequestBody AppSceneCostMaterialBom appSceneCostMaterialBom) { // appSceneCostMaterialBomService.updateById(appSceneCostMaterialBom); @@ -123,7 +123,7 @@ public class AppSceneCostMaterialBomController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { // appSceneCostMaterialBomService.removeById(id); @@ -138,7 +138,7 @@ public class AppSceneCostMaterialBomController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { // this.appSceneCostMaterialBomService.removeByIds(Arrays.asList(ids.split(","))); @@ -168,7 +168,7 @@ public class AppSceneCostMaterialBomController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { // return super.importExcel(request, response, AppSceneCostMaterialBom.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialProcessHoursController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialProcessHoursController.java index da07942..ea838e4 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialProcessHoursController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialProcessHoursController.java @@ -62,7 +62,7 @@ public class AppSceneCostMaterialProcessHoursController extends JeecgController< */ @AutoLog(value = "app_scene_cost_material_process_hours-添加") @ApiOperation(value = "app_scene_cost_material_process_hours-添加", notes = "app_scene_cost_material_process_hours-添加") - @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:add") + //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:add") @PostMapping(value = "/add") public Result add(@RequestBody AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours) { appSceneCostMaterialProcessHoursService.save(appSceneCostMaterialProcessHours); @@ -77,7 +77,7 @@ public class AppSceneCostMaterialProcessHoursController extends JeecgController< */ @AutoLog(value = "app_scene_cost_material_process_hours-编辑") @ApiOperation(value = "app_scene_cost_material_process_hours-编辑", notes = "app_scene_cost_material_process_hours-编辑") - @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:edit") + //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:edit") @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) public Result edit(@RequestBody AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours) { appSceneCostMaterialProcessHoursService.updateById(appSceneCostMaterialProcessHours); @@ -92,7 +92,7 @@ public class AppSceneCostMaterialProcessHoursController extends JeecgController< */ @AutoLog(value = "app_scene_cost_material_process_hours-通过id删除") @ApiOperation(value = "app_scene_cost_material_process_hours-通过id删除", notes = "app_scene_cost_material_process_hours-通过id删除") - @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:delete") + //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:delete") @DeleteMapping(value = "/delete") public Result delete(@RequestParam(name = "id", required = true) String id) { appSceneCostMaterialProcessHoursService.removeById(id); @@ -107,7 +107,7 @@ public class AppSceneCostMaterialProcessHoursController extends JeecgController< // */ // @AutoLog(value = "app_scene_cost_material_process_hours-批量删除") // @ApiOperation(value = "app_scene_cost_material_process_hours-批量删除", notes = "app_scene_cost_material_process_hours-批量删除") -// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:deleteBatch") +// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:deleteBatch") // @DeleteMapping(value = "/deleteBatch") // public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { // this.appSceneCostMaterialProcessHoursService.removeByIds(Arrays.asList(ids.split(","))); @@ -137,7 +137,7 @@ public class AppSceneCostMaterialProcessHoursController extends JeecgController< // * @param request // * @param appSceneCostMaterialProcessHours // */ -// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:exportXls") +// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:exportXls") // @RequestMapping(value = "/exportXls") // public ModelAndView exportXls(HttpServletRequest request, AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours) { // return super.exportXls(request, appSceneCostMaterialProcessHours, AppSceneCostMaterialProcessHours.class, "app_scene_cost_material_process_hours"); @@ -150,7 +150,7 @@ public class AppSceneCostMaterialProcessHoursController extends JeecgController< // * @param response // * @return // */ -// @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:importExcel") +// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:importExcel") // @RequestMapping(value = "/importExcel", method = RequestMethod.POST) // public Result importExcel(HttpServletRequest request, HttpServletResponse response) { // return super.importExcel(request, response, AppSceneCostMaterialProcessHours.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPartMissingInfoController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPartMissingInfoController.java index a451064..0af4a63 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPartMissingInfoController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPartMissingInfoController.java @@ -62,7 +62,7 @@ public class AppSceneCostPartMissingInfoController extends JeecgController add(@RequestBody AppSceneCostPartMissingInfo appSceneCostPartMissingInfo) { // appSceneCostPartMissingInfoService.save(appSceneCostPartMissingInfo); @@ -77,7 +77,7 @@ public class AppSceneCostPartMissingInfoController extends JeecgController edit(@RequestBody AppSceneCostPartMissingInfo appSceneCostPartMissingInfo) { // appSceneCostPartMissingInfoService.updateById(appSceneCostPartMissingInfo); @@ -92,7 +92,7 @@ public class AppSceneCostPartMissingInfoController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { // appSceneCostPartMissingInfoService.removeById(id); @@ -107,7 +107,7 @@ public class AppSceneCostPartMissingInfoController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { // this.appSceneCostPartMissingInfoService.removeByIds(Arrays.asList(ids.split(","))); @@ -137,7 +137,7 @@ public class AppSceneCostPartMissingInfoController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { // return super.importExcel(request, response, AppSceneCostPartMissingInfo.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseEvaluateController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseEvaluateController.java index c2e9fac..f379bc0 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseEvaluateController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseEvaluateController.java @@ -65,7 +65,7 @@ public class AppSceneCostPurchaseEvaluateController extends JeecgController add(@RequestBody AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate) { appSceneCostPurchaseEvaluateService.save(appSceneCostPurchaseEvaluate); @@ -80,7 +80,7 @@ public class AppSceneCostPurchaseEvaluateController extends JeecgController edit(@RequestBody AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate) { appSceneCostPurchaseEvaluateService.updateById(appSceneCostPurchaseEvaluate); @@ -95,7 +95,7 @@ public class AppSceneCostPurchaseEvaluateController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { appSceneCostPurchaseEvaluateService.removeById(id); @@ -110,7 +110,7 @@ public class AppSceneCostPurchaseEvaluateController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { // this.appSceneCostPurchaseEvaluateService.removeByIds(Arrays.asList(ids.split(","))); @@ -140,7 +140,7 @@ public class AppSceneCostPurchaseEvaluateController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { // return super.importExcel(request, response, AppSceneCostPurchaseEvaluate.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java index 4a750c1..1bfe828 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java @@ -62,7 +62,7 @@ public class AppSceneCostPurchasePriceController extends JeecgController add(@RequestBody AppSceneCostPurchasePrice appSceneCostPurchasePrice) { appSceneCostPurchasePriceService.save(appSceneCostPurchasePrice); @@ -77,7 +77,7 @@ public class AppSceneCostPurchasePriceController extends JeecgController edit(@RequestBody AppSceneCostPurchasePrice appSceneCostPurchasePrice) { appSceneCostPurchasePriceService.updateById(appSceneCostPurchasePrice); @@ -92,7 +92,7 @@ public class AppSceneCostPurchasePriceController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { appSceneCostPurchasePriceService.removeById(id); @@ -107,7 +107,7 @@ public class AppSceneCostPurchasePriceController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { this.appSceneCostPurchasePriceService.removeByIds(Arrays.asList(ids.split(","))); @@ -137,7 +137,7 @@ public class AppSceneCostPurchasePriceController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, AppSceneCostPurchasePrice.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostResultValueController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostResultValueController.java index fecbd6a..30f2ee7 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostResultValueController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostResultValueController.java @@ -157,7 +157,7 @@ public class AppSceneCostResultValueController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, AppSceneCostResultValue.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java index 2bca7fb..b8baada 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java @@ -62,7 +62,7 @@ public class AppSceneCostStandardDetailController extends JeecgController add(@RequestBody AppSceneCostStandardDetail appSceneCostStandardDetail) { // appSceneCostStandardDetailService.save(appSceneCostStandardDetail); @@ -77,7 +77,7 @@ public class AppSceneCostStandardDetailController extends JeecgController edit(@RequestBody AppSceneCostStandardDetail appSceneCostStandardDetail) { // appSceneCostStandardDetailService.updateById(appSceneCostStandardDetail); @@ -92,7 +92,7 @@ public class AppSceneCostStandardDetailController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { // appSceneCostStandardDetailService.removeById(id); @@ -107,7 +107,7 @@ public class AppSceneCostStandardDetailController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { // this.appSceneCostStandardDetailService.removeByIds(Arrays.asList(ids.split(","))); @@ -137,7 +137,7 @@ public class AppSceneCostStandardDetailController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { // return super.importExcel(request, response, AppSceneCostStandardDetail.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardVersionController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardVersionController.java index 0676b9d..d2554d7 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardVersionController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardVersionController.java @@ -60,7 +60,7 @@ public class AppSceneCostStandardVersionController extends JeecgController add(@RequestBody AppSceneCostStandardVersion appSceneCostStandardVersion) { // appSceneCostStandardVersionService.save(appSceneCostStandardVersion); @@ -75,7 +75,7 @@ public class AppSceneCostStandardVersionController extends JeecgController edit(@RequestBody AppSceneCostStandardVersion appSceneCostStandardVersion) { // appSceneCostStandardVersionService.updateById(appSceneCostStandardVersion); @@ -90,7 +90,7 @@ public class AppSceneCostStandardVersionController extends JeecgController delete(@RequestParam(name = "id", required = true) String id) { // appSceneCostStandardVersionService.removeById(id); @@ -105,7 +105,7 @@ public class AppSceneCostStandardVersionController extends JeecgController deleteBatch(@RequestParam(name = "ids", required = true) String ids) { // this.appSceneCostStandardVersionService.removeByIds(Arrays.asList(ids.split(","))); @@ -135,7 +135,7 @@ public class AppSceneCostStandardVersionController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { // return super.importExcel(request, response, AppSceneCostStandardVersion.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java index 2301d8f..bbe9ab3 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java @@ -2,6 +2,7 @@ package com.zzsmart.qomo.kn.cost.manage.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zzsmart.qomo.dao.entity.FlowDefinition; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPartMissingInfo; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion; @@ -11,6 +12,7 @@ import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPartMissingInfoMapper; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostCountService; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardVersionService; import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO; +import com.zzsmart.qomo.service.IDataFlowDefinitionService; import com.zzsmart.qomo.service.IDataFlowInstanceService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java index fba0566..e59f926 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java @@ -12,10 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; +import java.util.*; import java.util.stream.Collectors; @Service @@ -53,9 +50,12 @@ public class BomTreeServiceImpl implements BomTreeService { parentDataMap = parentNodeList.stream().collect(Collectors.toMap(AppSceneCostStandardDetail::getMaterialNumber, vo -> vo)); } else { //父类结果有多个(找出最上级节点) - Map> levelGroupMap = parentNodeList.stream().collect(Collectors.groupingBy(AppSceneCostStandardDetail::getLevel)); - TreeMap> levelTreeMap = new TreeMap<>(levelGroupMap); - parentDataMap = levelTreeMap.firstEntry().getValue().stream().collect(Collectors.toMap(AppSceneCostStandardDetail::getMaterialNumber, vo -> vo)); + Map> levelGroupMap = new HashMap<>(); + if (parentNodeList != null && parentNodeList.size() > 0) { + levelGroupMap = parentNodeList.stream().filter(s->s.getLevel()!=null).collect(Collectors.groupingBy(AppSceneCostStandardDetail::getLevel)); + TreeMap> levelTreeMap = new TreeMap<>(levelGroupMap); + parentDataMap = levelTreeMap.firstEntry().getValue().stream().filter(s->s.getMaterialNumber()!=null).collect(Collectors.toMap(AppSceneCostStandardDetail::getMaterialNumber, vo -> vo)); + } } //查询所有父节点下的子节点(即第二层叶子节点) List costStandardDetails = new ArrayList<>(); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java index 864b679..f43c06c 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java @@ -16,7 +16,17 @@ public class BomTreeBuilder { return result; } //1.把BOM信息分成按照物料号分组 - Map materialMap = sourceData.stream().filter(s -> s.getMaterialNumber() != null).collect(Collectors.toMap(AppSceneCostStandardDetail::getMaterialNumber, vo -> vo)); + Map materialMap = sourceData.stream().filter(s->s.getMaterialNumber()!=null) + .collect(Collectors.toMap( + // Key extractor + AppSceneCostStandardDetail::getMaterialNumber, + // Value mapper + detail -> detail, + // Merger function to handle duplicates + (existing, replacement) -> existing + )); + +// Map materialMap = sourceData.stream().filter(s -> s.getMaterialNumber() != null).collect(Collectors.toMap(AppSceneCostStandardDetail::getMaterialNumber, vo -> vo)); //查找最顶端的父类节点 if (parentDataMap == null || (parentDataMap != null && parentDataMap.size() < 1)) { parentDataMap = sourceData.stream().filter(s -> s.getParentMaterialNumber() == null).collect(Collectors.toMap(AppSceneCostStandardDetail::getMaterialNumber, vo -> vo));