From fd86a96a6d4b14fed3d1c88e99bfb286c72d5c4d Mon Sep 17 00:00:00 2001 From: bgy <1322446236@qq.com> Date: Sun, 8 Sep 2024 16:21:58 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E9=87=8D=E6=96=B0=E7=94=9F=E6=88=90bom?= =?UTF-8?q?=E3=80=81=E5=B7=A5=E5=BA=8F=E3=80=81=E9=87=87=E8=B4=AD=E4=BB=B7?= =?UTF-8?q?=E3=80=81=E7=89=88=E6=9C=AC=E5=8F=B7mapper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yml | 23 ++- qomo-kn-cost-manage/pom.xml | 16 ++ .../AppSceneCostBomRelevancyController.java | 159 ++++++++++++++++++ ...stProductProcessMaintenanceController.java | 159 ++++++++++++++++++ .../AppSceneCostPurchaseRecordController.java | 159 ++++++++++++++++++ ...AppSceneCostStandardVersionController.java | 10 +- .../entity/AppSceneCostBomRelevancy.java | 87 ++++++++++ ...AppSceneCostProductProcessMaintenance.java | 111 ++++++++++++ .../entity/AppSceneCostPurchaseRecord.java | 94 +++++++++++ .../entity/AppSceneCostStandardVersion.java | 112 ++++++++---- .../AppSceneCostBomRelevancyMapper.java | 17 ++ ...neCostProductProcessMaintenanceMapper.java | 17 ++ .../AppSceneCostPurchaseRecordMapper.java | 15 ++ .../AppSceneCostStandardVersionMapper.java | 6 +- .../xml/AppSceneCostBomRelevancyMapper.xml | 5 + ...eneCostProductProcessMaintenanceMapper.xml | 5 + .../xml/AppSceneCostPurchaseRecordMapper.xml | 5 + .../IAppSceneCostBomRelevancyService.java | 14 ++ ...eCostProductProcessMaintenanceService.java | 14 ++ .../IAppSceneCostPurchaseRecordService.java | 14 ++ .../AppSceneCostBomRelevancyServiceImpl.java | 19 +++ .../impl/AppSceneCostCountServiceImpl.java | 4 +- ...tProductProcessMaintenanceServiceImpl.java | 19 +++ ...AppSceneCostPurchaseRecordServiceImpl.java | 18 ++ 24 files changed, 1047 insertions(+), 55 deletions(-) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostBomRelevancyController.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostProductProcessMaintenanceController.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseRecordController.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostBomRelevancy.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostProductProcessMaintenance.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchaseRecord.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostBomRelevancyMapper.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostProductProcessMaintenanceMapper.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchaseRecordMapper.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostBomRelevancyMapper.xml create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostProductProcessMaintenanceMapper.xml create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchaseRecordMapper.xml create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostBomRelevancyService.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostProductProcessMaintenanceService.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseRecordService.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostBomRelevancyServiceImpl.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostProductProcessMaintenanceServiceImpl.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseRecordServiceImpl.java 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 18a44f0..121138b 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: 8098 + port: 8099 tomcat: max-swallow-size: -1 error: @@ -211,9 +211,9 @@ spring: # password: knphm2021 # driver-class-name: com.mysql.cj.jdbc.Driver master: - 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 + url: jdbc:mysql://158.158.4.51:3386/kn_energy_cost?useUnicode=true&allowMultiQueries=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useSSL=false + username: root + password: knEnergyCost0826# driver-class-name: com.mysql.cj.jdbc.Driver # 多数据源配置 #multi-datasource1: @@ -222,16 +222,23 @@ spring: #password: root #driver-class-name: com.mysql.cj.jdbc.Driver #redis 配置 - redis: +# redis: # database: 5 # host: 121.40.189.20 # port: 6389 + redis: database: 9 host: 192.168.50.9 port: 7379 password: 'zzboard' main: allow-circular-references: true +# redis: +# database: 10 +# host: localhost +# port: 6379 +# main: +# allow-circular-references: true #rabbitmq 配置 rabbitmq: @@ -265,6 +272,8 @@ mybatis-plus: # log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl # 返回类型为Map,显示null对应的字段 call-setters-on-nulls: true + security: + enabled: false #jeecg专用配置 minidao: base-package: org.jeecg.modules.jmreport.*,org.jeecg.modules.drag.* @@ -287,8 +296,8 @@ jeecg: #webapp文件路径 webapp: /opt/webapp shiro: -# excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/** - excludeUrls: /**/**,/**/**/** + excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/** + # excludeUrls: /**/**,/**/**/** #阿里云oss存储和大鱼短信秘钥配置 oss: diff --git a/qomo-kn-cost-manage/pom.xml b/qomo-kn-cost-manage/pom.xml index 7fa2ad8..827b04f 100644 --- a/qomo-kn-cost-manage/pom.xml +++ b/qomo-kn-cost-manage/pom.xml @@ -13,6 +13,7 @@ org.qomo.boot qomo-system-biz + 2.0.1-SNAPSHOT com.google.auto.service @@ -22,6 +23,21 @@ com.zzsmart.qomo qomo-data-integration + + + com.zzsmart.hdp.hive + hive-jdbc + + + + + com.zzsmart.hdp.hive + hive-jdbc + 2.6.5.0-292 + + + com.zzsmart.qomo + qomo-data-selfReport \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostBomRelevancyController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostBomRelevancyController.java new file mode 100644 index 0000000..0e806cb --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostBomRelevancyController.java @@ -0,0 +1,159 @@ +package com.zzsmart.qomo.kn.cost.manage.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostBomRelevancyService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +/** + * @Description: app_scene_cost_bom_relevancy + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +@Api(tags = "app_scene_cost_bom_relevancy") +@RestController +@RequestMapping("//appSceneCostBomRelevancy") +@Slf4j +public class AppSceneCostBomRelevancyController extends JeecgController { + @Autowired + private IAppSceneCostBomRelevancyService appSceneCostBomRelevancyService; + + /** + * 分页列表查询 + * + * @param appSceneCostBomRelevancy + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_bom_relevancy-分页列表查询") + @ApiOperation(value = "app_scene_cost_bom_relevancy-分页列表查询", notes = "app_scene_cost_bom_relevancy-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppSceneCostBomRelevancy appSceneCostBomRelevancy, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostBomRelevancy, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appSceneCostBomRelevancyService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param appSceneCostBomRelevancy + * @return + */ + @AutoLog(value = "app_scene_cost_bom_relevancy-添加") + @ApiOperation(value = "app_scene_cost_bom_relevancy-添加", notes = "app_scene_cost_bom_relevancy-添加") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_bom_relevancy:add") + @PostMapping(value = "/add") + public Result add(@RequestBody AppSceneCostBomRelevancy appSceneCostBomRelevancy) { + appSceneCostBomRelevancyService.save(appSceneCostBomRelevancy); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param appSceneCostBomRelevancy + * @return + */ + @AutoLog(value = "app_scene_cost_bom_relevancy-编辑") + @ApiOperation(value = "app_scene_cost_bom_relevancy-编辑", notes = "app_scene_cost_bom_relevancy-编辑") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_bom_relevancy:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result edit(@RequestBody AppSceneCostBomRelevancy appSceneCostBomRelevancy) { + appSceneCostBomRelevancyService.updateById(appSceneCostBomRelevancy); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "app_scene_cost_bom_relevancy-通过id删除") + @ApiOperation(value = "app_scene_cost_bom_relevancy-通过id删除", notes = "app_scene_cost_bom_relevancy-通过id删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_bom_relevancy:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + appSceneCostBomRelevancyService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "app_scene_cost_bom_relevancy-批量删除") + @ApiOperation(value = "app_scene_cost_bom_relevancy-批量删除", notes = "app_scene_cost_bom_relevancy-批量删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_bom_relevancy:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + this.appSceneCostBomRelevancyService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "app_scene_cost_bom_relevancy-通过id查询") + @ApiOperation(value = "app_scene_cost_bom_relevancy-通过id查询", notes = "app_scene_cost_bom_relevancy-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + AppSceneCostBomRelevancy appSceneCostBomRelevancy = appSceneCostBomRelevancyService.getById(id); + if (appSceneCostBomRelevancy == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appSceneCostBomRelevancy); + } + + /** + * 导出excel + * + * @param request + * @param appSceneCostBomRelevancy + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_bom_relevancy:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AppSceneCostBomRelevancy appSceneCostBomRelevancy) { + return super.exportXls(request, appSceneCostBomRelevancy, AppSceneCostBomRelevancy.class, "app_scene_cost_bom_relevancy"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_bom_relevancy:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, AppSceneCostBomRelevancy.class); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostProductProcessMaintenanceController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostProductProcessMaintenanceController.java new file mode 100644 index 0000000..8d64974 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostProductProcessMaintenanceController.java @@ -0,0 +1,159 @@ +package com.zzsmart.qomo.kn.cost.manage.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostProductProcessMaintenance; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostProductProcessMaintenanceService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +/** + * @Description: app_scene_cost_product_process_maintenance + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +//@Api(tags = "app_scene_cost_product_process_maintenance") +@RestController +@RequestMapping("//appSceneCostProductProcessMaintenance") +@Slf4j +public class AppSceneCostProductProcessMaintenanceController extends JeecgController { + @Autowired + private IAppSceneCostProductProcessMaintenanceService appSceneCostProductProcessMaintenanceService; + + /** + * 分页列表查询 + * + * @param appSceneCostProductProcessMaintenance + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_product_process_maintenance-分页列表查询") + @ApiOperation(value = "app_scene_cost_product_process_maintenance-分页列表查询", notes = "app_scene_cost_product_process_maintenance-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppSceneCostProductProcessMaintenance appSceneCostProductProcessMaintenance, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostProductProcessMaintenance, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appSceneCostProductProcessMaintenanceService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param appSceneCostProductProcessMaintenance + * @return + */ + @AutoLog(value = "app_scene_cost_product_process_maintenance-添加") + @ApiOperation(value = "app_scene_cost_product_process_maintenance-添加", notes = "app_scene_cost_product_process_maintenance-添加") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_product_process_maintenance:add") + @PostMapping(value = "/add") + public Result add(@RequestBody AppSceneCostProductProcessMaintenance appSceneCostProductProcessMaintenance) { + appSceneCostProductProcessMaintenanceService.save(appSceneCostProductProcessMaintenance); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param appSceneCostProductProcessMaintenance + * @return + */ + @AutoLog(value = "app_scene_cost_product_process_maintenance-编辑") + @ApiOperation(value = "app_scene_cost_product_process_maintenance-编辑", notes = "app_scene_cost_product_process_maintenance-编辑") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_product_process_maintenance:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result edit(@RequestBody AppSceneCostProductProcessMaintenance appSceneCostProductProcessMaintenance) { + appSceneCostProductProcessMaintenanceService.updateById(appSceneCostProductProcessMaintenance); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "app_scene_cost_product_process_maintenance-通过id删除") + @ApiOperation(value = "app_scene_cost_product_process_maintenance-通过id删除", notes = "app_scene_cost_product_process_maintenance-通过id删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_product_process_maintenance:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + appSceneCostProductProcessMaintenanceService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "app_scene_cost_product_process_maintenance-批量删除") + @ApiOperation(value = "app_scene_cost_product_process_maintenance-批量删除", notes = "app_scene_cost_product_process_maintenance-批量删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_product_process_maintenance:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + this.appSceneCostProductProcessMaintenanceService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "app_scene_cost_product_process_maintenance-通过id查询") + @ApiOperation(value = "app_scene_cost_product_process_maintenance-通过id查询", notes = "app_scene_cost_product_process_maintenance-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + AppSceneCostProductProcessMaintenance appSceneCostProductProcessMaintenance = appSceneCostProductProcessMaintenanceService.getById(id); + if (appSceneCostProductProcessMaintenance == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appSceneCostProductProcessMaintenance); + } + + /** + * 导出excel + * + * @param request + * @param appSceneCostProductProcessMaintenance + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_product_process_maintenance:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AppSceneCostProductProcessMaintenance appSceneCostProductProcessMaintenance) { + return super.exportXls(request, appSceneCostProductProcessMaintenance, AppSceneCostProductProcessMaintenance.class, "app_scene_cost_product_process_maintenance"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_product_process_maintenance:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, AppSceneCostProductProcessMaintenance.class); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseRecordController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseRecordController.java new file mode 100644 index 0000000..03d8c1c --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchaseRecordController.java @@ -0,0 +1,159 @@ +package com.zzsmart.qomo.kn.cost.manage.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseRecord; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchaseRecordService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.servlet.ModelAndView; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; + +/** + * @Description: app_scene_cost_purchase_record + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +//@Api(tags = "app_scene_cost_purchase_record") +@RestController +@RequestMapping("//appSceneCostPurchaseRecord") +@Slf4j +public class AppSceneCostPurchaseRecordController extends JeecgController { + @Autowired + private IAppSceneCostPurchaseRecordService appSceneCostPurchaseRecordService; + + /** + * 分页列表查询 + * + * @param appSceneCostPurchaseRecord + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_purchase_record-分页列表查询") + @ApiOperation(value = "app_scene_cost_purchase_record-分页列表查询", notes = "app_scene_cost_purchase_record-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppSceneCostPurchaseRecord appSceneCostPurchaseRecord, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostPurchaseRecord, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appSceneCostPurchaseRecordService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param appSceneCostPurchaseRecord + * @return + */ + @AutoLog(value = "app_scene_cost_purchase_record-添加") + @ApiOperation(value = "app_scene_cost_purchase_record-添加", notes = "app_scene_cost_purchase_record-添加") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_record:add") + @PostMapping(value = "/add") + public Result add(@RequestBody AppSceneCostPurchaseRecord appSceneCostPurchaseRecord) { + appSceneCostPurchaseRecordService.save(appSceneCostPurchaseRecord); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param appSceneCostPurchaseRecord + * @return + */ + @AutoLog(value = "app_scene_cost_purchase_record-编辑") + @ApiOperation(value = "app_scene_cost_purchase_record-编辑", notes = "app_scene_cost_purchase_record-编辑") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_record:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) + public Result edit(@RequestBody AppSceneCostPurchaseRecord appSceneCostPurchaseRecord) { + appSceneCostPurchaseRecordService.updateById(appSceneCostPurchaseRecord); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "app_scene_cost_purchase_record-通过id删除") + @ApiOperation(value = "app_scene_cost_purchase_record-通过id删除", notes = "app_scene_cost_purchase_record-通过id删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_record:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + appSceneCostPurchaseRecordService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "app_scene_cost_purchase_record-批量删除") + @ApiOperation(value = "app_scene_cost_purchase_record-批量删除", notes = "app_scene_cost_purchase_record-批量删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_record:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + this.appSceneCostPurchaseRecordService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "app_scene_cost_purchase_record-通过id查询") + @ApiOperation(value = "app_scene_cost_purchase_record-通过id查询", notes = "app_scene_cost_purchase_record-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + AppSceneCostPurchaseRecord appSceneCostPurchaseRecord = appSceneCostPurchaseRecordService.getById(id); + if (appSceneCostPurchaseRecord == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appSceneCostPurchaseRecord); + } + + /** + * 导出excel + * + * @param request + * @param appSceneCostPurchaseRecord + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_record:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AppSceneCostPurchaseRecord appSceneCostPurchaseRecord) { + return super.exportXls(request, appSceneCostPurchaseRecord, AppSceneCostPurchaseRecord.class, "app_scene_cost_purchase_record"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_record:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, AppSceneCostPurchaseRecord.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 d2554d7..6bfa100 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 @@ -7,18 +7,16 @@ import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardVersionService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.apache.shiro.authz.annotation.RequiresPermissions; import org.jeecg.common.api.vo.Result; -import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.Arrays; /** * @Description: app_scene_cost_standard_version diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostBomRelevancy.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostBomRelevancy.java new file mode 100644 index 0000000..a26363e --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostBomRelevancy.java @@ -0,0 +1,87 @@ +package com.zzsmart.qomo.kn.cost.manage.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: app_scene_cost_bom_relevancy + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +@Data +@TableName("app_scene_cost_bom_relevancy") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="app_scene_cost_bom_relevancy对象", description="app_scene_cost_bom_relevancy") +public class AppSceneCostBomRelevancy implements Serializable { + private static final long serialVersionUID = 1L; + + /**父物料号*/ + @Excel(name = "父物料号", width = 15) + @ApiModelProperty(value = "父物料号") + private String matnr; + /**版本号*/ + @Excel(name = "版本号", width = 15) + @ApiModelProperty(value = "版本号") + private String versionNumber; + /**posnr*/ + @Excel(name = "posnr", width = 15) + @ApiModelProperty(value = "posnr") + private String posnr; + /**工厂*/ + @Excel(name = "工厂", width = 15) + @ApiModelProperty(value = "工厂") + private String werks; + /**bmeng*/ + @Excel(name = "bmeng", width = 15) + @ApiModelProperty(value = "bmeng") + private BigDecimal bmeng; + /**stlan*/ + @Excel(name = "stlan", width = 15) + @ApiModelProperty(value = "stlan") + private String stlan; + /**antxt*/ + @Excel(name = "antxt", width = 15) + @ApiModelProperty(value = "antxt") + private String antxt; + /**子物料号*/ + @Excel(name = "子物料号", width = 15) + @ApiModelProperty(value = "子物料号") + private String idnrk; + /**领用量*/ + @Excel(name = "领用量", width = 15) + @ApiModelProperty(value = "领用量") + private String meins; + /**menge*/ + @Excel(name = "menge", width = 15) + @ApiModelProperty(value = "menge") + private BigDecimal menge; + /**ausch*/ + @Excel(name = "ausch", width = 15) + @ApiModelProperty(value = "ausch") + private BigDecimal ausch; + /**datuv*/ + @Excel(name = "datuv", width = 15) + @ApiModelProperty(value = "datuv") + private String datuv; + /**potx1*/ + @Excel(name = "potx1", width = 15) + @ApiModelProperty(value = "potx1") + private String potx1; +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostProductProcessMaintenance.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostProductProcessMaintenance.java new file mode 100644 index 0000000..2e02a03 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostProductProcessMaintenance.java @@ -0,0 +1,111 @@ +package com.zzsmart.qomo.kn.cost.manage.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: app_scene_cost_product_process_maintenance + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +@Data +@TableName("app_scene_cost_product_process_maintenance") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="app_scene_cost_product_process_maintenance对象", description="app_scene_cost_product_process_maintenance") +public class AppSceneCostProductProcessMaintenance implements Serializable { + private static final long serialVersionUID = 1L; + + /**工厂*/ + @Excel(name = "工厂", width = 15) + @ApiModelProperty(value = "工厂") + private String factory; + /**物料号*/ + @Excel(name = "物料号", width = 15) + @ApiModelProperty(value = "物料号") + private String mainPartNumber; + /**工序编号*/ + @Excel(name = "工序编号", width = 15) + @ApiModelProperty(value = "工序编号") + private String processRouteNumber; + /**序号*/ + @Excel(name = "序号", width = 15) + @ApiModelProperty(value = "序号") + private String serialNumber; + /**工序名称*/ + @Excel(name = "工序名称", width = 15) + @ApiModelProperty(value = "工序名称") + private String processName; + /**成本中心*/ + @Excel(name = "成本中心", width = 15) + @ApiModelProperty(value = "成本中心") + private String costCenterCode; + /**准备工时*/ + @Excel(name = "准备工时", width = 15) + @ApiModelProperty(value = "准备工时") + private BigDecimal prepareHour; + /**人工工时*/ + @Excel(name = "人工工时", width = 15) + @ApiModelProperty(value = "人工工时") + private BigDecimal laborHour; + /**设备工时*/ + @Excel(name = "设备工时", width = 15) + @ApiModelProperty(value = "设备工时") + private BigDecimal machineHour; + /**燃动工时*/ + @Excel(name = "燃动工时", width = 15) + @ApiModelProperty(value = "燃动工时") + private BigDecimal burningHour; + /**辅料工时*/ + @Excel(name = "辅料工时", width = 15) + @ApiModelProperty(value = "辅料工时") + private BigDecimal auxiliaryHour; + /**其他工时*/ + @Excel(name = "其他工时", width = 15) + @ApiModelProperty(value = "其他工时") + private BigDecimal otherHour; + /**hourType*/ + @Excel(name = "hourType", width = 15) + @ApiModelProperty(value = "hourType") + private String hourType; + /**版本号*/ + @Excel(name = "版本号", width = 15) + @ApiModelProperty(value = "版本号") + private String versionNumber; + /**guardian*/ + @Excel(name = "guardian", width = 15) + @ApiModelProperty(value = "guardian") + private String guardian; + /**maintenanceTime*/ + @Excel(name = "maintenanceTime", width = 15) + @ApiModelProperty(value = "maintenanceTime") + private String maintenanceTime; + /**reserve1*/ + @Excel(name = "reserve1", width = 15) + @ApiModelProperty(value = "reserve1") + private String reserve1; + /**reserve2*/ + @Excel(name = "reserve2", width = 15) + @ApiModelProperty(value = "reserve2") + private BigDecimal reserve2; + /**jobCode*/ + @Excel(name = "jobCode", width = 15) + @ApiModelProperty(value = "jobCode") + private String jobCode; +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchaseRecord.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchaseRecord.java new file mode 100644 index 0000000..3c963ae --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchaseRecord.java @@ -0,0 +1,94 @@ +package com.zzsmart.qomo.kn.cost.manage.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description: app_scene_cost_purchase_record + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +@Data +@TableName("app_scene_cost_purchase_record") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "app_scene_cost_purchase_record对象", description = "app_scene_cost_purchase_record") +public class AppSceneCostPurchaseRecord implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 工厂 + */ + @Excel(name = "工厂", width = 15) + @ApiModelProperty(value = "工厂") + private String werks; + /** + * 组织 + */ + @Excel(name = "组织", width = 15) + @ApiModelProperty(value = "组织") + private String ekorg; + /** + * 物料号 + */ + @Excel(name = "物料号", width = 15) + @ApiModelProperty(value = "物料号") + private String infnr; + /** + * 供应商代码 + */ + @Excel(name = "供应商代码", width = 15) + @ApiModelProperty(value = "供应商代码") + private String lifnr; + /** + * esokz + */ + @Excel(name = "esokz", width = 15) + @ApiModelProperty(value = "esokz") + private String esokz; + /** + * 单价 + */ + @Excel(name = "单价", width = 15) + @ApiModelProperty(value = "单价") + private BigDecimal netpr; + /** + * 币种 + */ + @Excel(name = "币种", width = 15) + @ApiModelProperty(value = "币种") + private String waers; + /** + * 有效截止时间 + */ + @Excel(name = "有效截止时间", width = 15) + @ApiModelProperty(value = "有效截止时间") + private String prdat; + /** + * 有效开始时间 + */ + @Excel(name = "有效开始时间", width = 15) + @ApiModelProperty(value = "有效开始时间") + private String erdat; + /** + * ukurs + */ + @Excel(name = "ukurs", width = 15) + @ApiModelProperty(value = "ukurs") + private BigDecimal ukurs; + /** + * 人名币单价 + */ + @Excel(name = "人名币单价", width = 15) + @ApiModelProperty(value = "人名币单价") + private BigDecimal cnyPrice; +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardVersion.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardVersion.java index 62692e6..d686996 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardVersion.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardVersion.java @@ -19,7 +19,7 @@ import java.util.Date; /** * @Description: app_scene_cost_standard_version * @Author: jeecg-boot - * @Date: 2024-08-02 + * @Date: 2024-09-08 * @Version: V1.0 */ @Data @@ -32,71 +32,111 @@ public class AppSceneCostStandardVersion implements Serializable { private static final long serialVersionUID = 1L; /** - * id + * 主键id */ @TableId(type = IdType.ASSIGN_ID) - @ApiModelProperty(value = "id") - private String id; + @ApiModelProperty(value = "主键id") + private Integer id; /** - * 图号 + * 项目名称 */ - @Excel(name = "图号", width = 15) - @ApiModelProperty(value = "图号") - private String figureNumber; + @Excel(name = "项目名称", width = 15) + @ApiModelProperty(value = "项目名称") + private String projectname; /** - * 阶段,A-初始,B-首批,C-量产 + * 阶段 */ - @Excel(name = "阶段,A-初始,B-首批,C-量产", width = 15) - @ApiModelProperty(value = "阶段,A-初始,B-首批,C-量产") + @Excel(name = "阶段", width = 15) + @ApiModelProperty(value = "阶段") private String stage; /** - * 物料号,关联kn_new_sap_mara表matnr字段 + * 日期 */ - @Excel(name = "物料号,关联kn_new_sap_mara表matnr字段", width = 15) - @ApiModelProperty(value = "物料号,关联kn_new_sap_mara表matnr字段") - private String materialNumber; + @Excel(name = "日期", width = 15) + @ApiModelProperty(value = "日期") + private String date; /** * 版本号 */ @Excel(name = "版本号", width = 15) @ApiModelProperty(value = "版本号") - private String versionNumber; + private String version; /** - * 版本状态 + * 工厂 */ - @Excel(name = "版本状态", width = 15) - @ApiModelProperty(value = "版本状态") - private String versionStatus; + @Excel(name = "工厂", width = 15) + @ApiModelProperty(value = "工厂") + private String werks; /** - * 创建人 + * 物料号 */ - @ApiModelProperty(value = "创建人") - private String createBy; + @Excel(name = "物料号", width = 15) + @ApiModelProperty(value = "物料号") + private String matnr; + /** + * 状态 + */ + @Excel(name = "状态", width = 15) + @ApiModelProperty(value = "状态") + private String status; /** * 创建时间 */ + @Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "创建时间") - private Date createTime; + private Date createdtime; /** - * 修改人 - */ - @ApiModelProperty(value = "修改人") - private String updateBy; - /** - * 修改时间 + * 完成时间 */ + @Excel(name = "完成时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @ApiModelProperty(value = "修改时间") - private Date updateTime; + @ApiModelProperty(value = "完成时间") + private Date finishtime; /** - * 备注 + * batchname */ - @Excel(name = "备注", width = 15) - @ApiModelProperty(value = "备注") - private String remark; + @Excel(name = "batchname", width = 15) + @ApiModelProperty(value = "batchname") + private String batchname; + /** + * userid + */ + @Excel(name = "userid", width = 15) + @ApiModelProperty(value = "userid") + private Integer userid; + /** + * 图号 + */ + @Excel(name = "图号", width = 15) + @ApiModelProperty(value = "图号") + private String graphicnumber; + /** + * projectpspid + */ + @Excel(name = "projectpspid", width = 15) + @ApiModelProperty(value = "projectpspid") + private String projectpspid; + /** + * projectcate + */ + @Excel(name = "projectcate", width = 15) + @ApiModelProperty(value = "projectcate") + private String projectcate; + /** + * keylost + */ + @Excel(name = "keylost", width = 15) + @ApiModelProperty(value = "keylost") + private Integer keylost; + /** + * mknum + */ + @Excel(name = "mknum", width = 15) + @ApiModelProperty(value = "mknum") + private Integer mknum; /** * 年份 */ diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostBomRelevancyMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostBomRelevancyMapper.java new file mode 100644 index 0000000..b4a85d8 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostBomRelevancyMapper.java @@ -0,0 +1,17 @@ +package com.zzsmart.qomo.kn.cost.manage.mapper; + +import java.util.List; + +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy; +import org.apache.ibatis.annotations.Param; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: app_scene_cost_bom_relevancy + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +public interface AppSceneCostBomRelevancyMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostProductProcessMaintenanceMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostProductProcessMaintenanceMapper.java new file mode 100644 index 0000000..7c75270 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostProductProcessMaintenanceMapper.java @@ -0,0 +1,17 @@ +package com.zzsmart.qomo.kn.cost.manage.mapper; + +import java.util.List; + +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostProductProcessMaintenance; +import org.apache.ibatis.annotations.Param; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: app_scene_cost_product_process_maintenance + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +public interface AppSceneCostProductProcessMaintenanceMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchaseRecordMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchaseRecordMapper.java new file mode 100644 index 0000000..d78e4ea --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchaseRecordMapper.java @@ -0,0 +1,15 @@ +package com.zzsmart.qomo.kn.cost.manage.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseRecord; + + +/** + * @Description: app_scene_cost_purchase_record + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +public interface AppSceneCostPurchaseRecordMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardVersionMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardVersionMapper.java index e25bd53..6489601 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardVersionMapper.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardVersionMapper.java @@ -1,15 +1,13 @@ package com.zzsmart.qomo.kn.cost.manage.mapper; -import java.util.List; -import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion; -import org.apache.ibatis.annotations.Param; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion; /** * @Description: app_scene_cost_standard_version * @Author: jeecg-boot - * @Date: 2024-08-02 + * @Date: 2024-09-08 * @Version: V1.0 */ public interface AppSceneCostStandardVersionMapper extends BaseMapper { diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostBomRelevancyMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostBomRelevancyMapper.xml new file mode 100644 index 0000000..4d8a366 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostBomRelevancyMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostProductProcessMaintenanceMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostProductProcessMaintenanceMapper.xml new file mode 100644 index 0000000..997c398 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostProductProcessMaintenanceMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchaseRecordMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchaseRecordMapper.xml new file mode 100644 index 0000000..52fce70 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchaseRecordMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostBomRelevancyService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostBomRelevancyService.java new file mode 100644 index 0000000..bad9322 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostBomRelevancyService.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy; + +/** + * @Description: app_scene_cost_bom_relevancy + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +public interface IAppSceneCostBomRelevancyService extends IService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostProductProcessMaintenanceService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostProductProcessMaintenanceService.java new file mode 100644 index 0000000..76ce058 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostProductProcessMaintenanceService.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostProductProcessMaintenance; + +/** + * @Description: app_scene_cost_product_process_maintenance + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +public interface IAppSceneCostProductProcessMaintenanceService extends IService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseRecordService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseRecordService.java new file mode 100644 index 0000000..ce23c84 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseRecordService.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseRecord; + +/** + * @Description: app_scene_cost_purchase_record + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +public interface IAppSceneCostPurchaseRecordService extends IService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostBomRelevancyServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostBomRelevancyServiceImpl.java new file mode 100644 index 0000000..a9b0247 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostBomRelevancyServiceImpl.java @@ -0,0 +1,19 @@ +package com.zzsmart.qomo.kn.cost.manage.service.impl; + +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostBomRelevancyMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostBomRelevancyService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: app_scene_cost_bom_relevancy + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +@Service +public class AppSceneCostBomRelevancyServiceImpl extends ServiceImpl implements IAppSceneCostBomRelevancyService { + +} 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 bbe9ab3..52198a1 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 @@ -102,11 +102,11 @@ public class AppSceneCostCountServiceImpl extends ServiceImpl implements IAppSceneCostProductProcessMaintenanceService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseRecordServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseRecordServiceImpl.java new file mode 100644 index 0000000..1a4d138 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseRecordServiceImpl.java @@ -0,0 +1,18 @@ +package com.zzsmart.qomo.kn.cost.manage.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseRecord; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPurchaseRecordMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchaseRecordService; +import org.springframework.stereotype.Service; + +/** + * @Description: app_scene_cost_purchase_record + * @Author: jeecg-boot + * @Date: 2024-09-08 + * @Version: V1.0 + */ +@Service +public class AppSceneCostPurchaseRecordServiceImpl extends ServiceImpl implements IAppSceneCostPurchaseRecordService { + +} -- 2.54.0 From 734414f3ba3557f05fb153600c3c530c663cbc7f Mon Sep 17 00:00:00 2001 From: bgy <1322446236@qq.com> Date: Fri, 13 Sep 2024 19:57:57 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E3=80=82=E4=BC=98=E5=8C=96=E6=88=90=E6=9C=AC?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppSceneCostModelController.java | 62 +++++++++-- .../cost/manage/entity/AppSceneCostModel.java | 103 ++++++++++-------- .../manage/enums/CostModelStatusEnum.java | 65 +++++++++++ .../manage/plugin/StandardCostService.java | 2 +- .../cost/manage/vo/CostModelDefinitionVO.java | 45 ++++++++ 5 files changed, 223 insertions(+), 54 deletions(-) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/CostModelStatusEnum.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostModelDefinitionVO.java diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java index fc5d5e4..1018688 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java @@ -5,12 +5,17 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.zzsmart.qomo.dao.entity.FlowDefinition; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostModel; +import com.zzsmart.qomo.kn.cost.manage.enums.CostModelStatusEnum; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostCountMapper; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostModelMapper; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostModelService; +import com.zzsmart.qomo.kn.cost.manage.vo.CostModelDefinitionVO; import com.zzsmart.qomo.service.IDataFlowDefinitionService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; -import org.apache.shiro.authz.annotation.RequiresPermissions; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.query.QueryGenerator; @@ -20,6 +25,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import java.util.Date; import java.util.List; +import java.util.Random; /** * @Description: app_scene_cost_model @@ -36,7 +42,10 @@ public class AppSceneCostModelController { private IAppSceneCostModelService appSceneCostModelService; @Autowired private IDataFlowDefinitionService flowDefinitionService; - + @Autowired + private AppSceneCostCountMapper appSceneCostCountMapper; + @Autowired + private AppSceneCostModelMapper costModelMapper; /** * 标准成本模型分页列表查询 * @@ -71,17 +80,41 @@ public class AppSceneCostModelController { /** * 添加标准成本模型 * - * @param flowDefinition + * @param modelDefinitionVO * @return */ @AutoLog(value = "app_scene_cost_model-添加") @ApiOperation(value = "app_scene_cost_model-添加", notes = "app_scene_cost_model-添加") @PostMapping(value = "/add") - public Result add(@RequestBody FlowDefinition flowDefinition) { - flowDefinition.setCreateTime(new Date()); - flowDefinition.setUpdateTime(new Date()); - FlowDefinition definition = flowDefinitionService.add(flowDefinition); - return Result.OK(definition); + public Result add(@RequestBody CostModelDefinitionVO modelDefinitionVO) { + try { + FlowDefinition flowDefinition = new FlowDefinition(); + //TODO 新增平台层模型定义记录 + String flowCode = "FLOW_" + System.currentTimeMillis() + new Random(10000).nextInt(); + flowDefinition.setUpdateTime(new Date()); + flowDefinition.setCreateTime(new Date()); + flowDefinition.setCode(flowCode); + flowDefinition.setProjectId(modelDefinitionVO.getProjectId()); + flowDefinition.setUserId("1744546658109349889"); + flowDefinition.setUserName("系统管理员"); + flowDefinition.setTenantId(-1); + flowDefinition.setEnvironmentId(1); + flowDefinition.setName(modelDefinitionVO.getModelName()); + FlowDefinition definition = flowDefinitionService.add(flowDefinition); + AppSceneCostModel forecastModel = new AppSceneCostModel(); + forecastModel.setModelType(modelDefinitionVO.getModelType()); + forecastModel.setModelName(modelDefinitionVO.getModelName()); + forecastModel.setStatus(CostModelStatusEnum.Draft.getCode()); + //2.新模型记录 + forecastModel.setFlowDefinitionId(definition.getId()); + forecastModel.setUpdateTime(new Date()); + forecastModel.setCreateTime(new Date()); + costModelMapper.insert(forecastModel); + + } catch (Exception e) { + return Result.error("新增失败"); + } + return Result.OK("新增成功"); } /** @@ -108,6 +141,19 @@ public class AppSceneCostModelController { @ApiOperation(value = "app_scene_cost_model-通过id删除", notes = "app_scene_cost_model-通过id删除") @DeleteMapping(value = "/delete") public Result delete(@RequestParam(name = "id", required = true) Integer id) { + //检查模型是否被引用或挂载 + if (id != null) { + FlowDefinition flowDefinition = flowDefinitionService.getById(id); + if (flowDefinition != null) { + Integer id1 = flowDefinition.getId(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("flow_definition_id", id1); + Long aLong = appSceneCostCountMapper.selectCount(queryWrapper); + if (aLong > 0) { + return Result.error("该模型正在被引用,无法删除!"); + } + } + } flowDefinitionService.delete(id); return Result.OK("删除成功!"); } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostModel.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostModel.java index a80a2fd..50700f6 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostModel.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostModel.java @@ -1,75 +1,88 @@ package com.zzsmart.qomo.kn.cost.manage.entity; -import java.io.Serializable; -import java.io.UnsupportedEncodingException; -import java.util.Date; -import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.TableLogic; -import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import org.jeecgframework.poi.excel.annotation.Excel; -import org.jeecg.common.aspect.annotation.Dict; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import lombok.EqualsAndHashCode; +import lombok.*; import lombok.experimental.Accessors; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; /** * @Description: app_scene_cost_model * @Author: jeecg-boot - * @Date: 2024-07-29 + * @Date: 2024-09-09 * @Version: V1.0 */ @Data +@Builder +@AllArgsConstructor +@NoArgsConstructor @TableName("app_scene_cost_model") @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) -@ApiModel(value="app_scene_cost_model对象", description="app_scene_cost_model") +@ApiModel(value = "app_scene_cost_model对象", description = "app_scene_cost_model") public class AppSceneCostModel implements Serializable { private static final long serialVersionUID = 1L; - /**主键*/ - @TableId(type = IdType.ASSIGN_ID) + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) @ApiModelProperty(value = "主键") private Integer id; - /**物料编号*/ - @Excel(name = "物料编号", width = 15) - @ApiModelProperty(value = "物料编号") - private String materialNo; - /**图号*/ - @Excel(name = "图号", width = 15) - @ApiModelProperty(value = "图号") - private String drawingNo; - /**标准成本计算流程id*/ - @Excel(name = "标准成本计算流程id", width = 15) - @ApiModelProperty(value = "标准成本计算流程id") + /** + * 模型名称 + */ + @Excel(name = "模型名称", width = 15) + @ApiModelProperty(value = "模型名称") + private String modelName; + /** + * 模型类型(标准成本、成本挖掘) + */ + @Excel(name = "模型类型(标准成本、成本挖掘)", width = 15) + @ApiModelProperty(value = "模型类型(标准成本、成本挖掘)") + private String modelType; + /** + * 模型定义id + */ + @Excel(name = "模型定义id", width = 15) + @ApiModelProperty(value = "模型定义id") private Integer flowDefinitionId; - /**状态*/ - @Excel(name = "状态", width = 15) - @ApiModelProperty(value = "状态") - private Integer status; - /**模型版本*/ - @Excel(name = "模型版本", width = 15) - @ApiModelProperty(value = "模型版本") - private String modelVersion; - /**创建人*/ - @ApiModelProperty(value = "创建人") - private Integer createBy; - /**创建时间*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + /** + * 状态(草稿、已发布、已作废) + */ + @Excel(name = "状态(草稿、已发布、已作废)", width = 15) + @ApiModelProperty(value = "状态(草稿、已发布、已作废)") + private String status; + /** + * 创建时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "创建时间") private Date createTime; - /**更新人*/ - @ApiModelProperty(value = "更新人") - private Integer updateBy; - /**更新时间*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + /** + * 创建人 + */ + @ApiModelProperty(value = "创建人") + private String createBy; + /** + * 更新时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty(value = "更新时间") private Date updateTime; + /** + * 更新人 + */ + @ApiModelProperty(value = "更新人") + private String updateBy; } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/CostModelStatusEnum.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/CostModelStatusEnum.java new file mode 100644 index 0000000..08609fa --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/CostModelStatusEnum.java @@ -0,0 +1,65 @@ +package com.zzsmart.qomo.kn.cost.manage.enums; + +/** + * 预测模型状态枚举 + */ +public enum CostModelStatusEnum { + /** + * 草稿 + */ + Draft("Draft", "草稿"), + /** + * 已删除 + */ + Delete("Deleted", "已删除"), + /** + * 已发布 + */ + Published("Published", "已发布"); + + private final String code; + private final String name; + + CostModelStatusEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public String getCode() { + return code; + } + + public String getName() { + return name; + } + + /** + * 根据code获取text + * + * @param codeNo + * @return + */ + public static String getTextByCode(String codeNo) { + for (CostModelStatusEnum value : CostModelStatusEnum.values()) { + if (value.getCode().equals(codeNo)) { + return value.name(); + } + } + return codeNo.toString(); + } + + /** + * 根据text获取code + * + * @param name + * @return + */ + public static String getCodeByName(String name) { + for (CostModelStatusEnum value : CostModelStatusEnum.values()) { + if (value.name().equals(name)) { + return value.name(); + } + } + return name; + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java index 33673e8..1f5fd9a 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java @@ -478,7 +478,7 @@ public class StandardCostService { //获取最上层的物料号 String topMaterialCode = flowTaskInfoVO.getTopMaterialCode(); //获取任务类型 - String taskType = parameters.getTaskType(); + String taskType = parameters.getTaksType(); //获取任务代码 String taskCode = flowTaskInfoVO.getTaskCode(); //获取流程id diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostModelDefinitionVO.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostModelDefinitionVO.java new file mode 100644 index 0000000..35bf7b9 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostModelDefinitionVO.java @@ -0,0 +1,45 @@ +package com.zzsmart.qomo.kn.cost.manage.vo; + +import com.zzsmart.qomo.common.enums.ReleaseState; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * 模型信息封装 + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class CostModelDefinitionVO extends AppSceneCostModel { + @ApiModelProperty("encoding") + private String code; + @ApiModelProperty("flow definition name") + private String name; + @ApiModelProperty("flow definition version") + private Integer version; + @ApiModelProperty("flow definition release state: 0:offline,1:online") + private ReleaseState releaseState; + @ApiModelProperty("定时调度表达式") + private String scheduleCron; + @ApiModelProperty("任务调度模式(1任务队列领取模式(推荐) 2所有集群服务器均可同时运行 3只有主服务器可运行(主服务器失败时其他服务器接管) 4由调度服务器统一调度)") + private Integer scheduleMode; + @ApiModelProperty("依赖周期(分钟)") + private Integer dependencyCycle; + @ApiModelProperty("在任务队列模式下可以根据任务重要性来领取任务(10为最高)") + private Integer taskImportance; + @ApiModelProperty("运行方式(0 禁用 1手动触发 2定时自动调度 3依赖上级流程)") + private Integer runMode; + @ApiModelProperty("project id") + private Integer projectId; + @ApiModelProperty("project code") + private String projectCode; + @ApiModelProperty("环境配置ID") + private Integer environmentId; + @ApiModelProperty("租户ID") + private Integer tenantId; +} -- 2.54.0 From 1eb6e5915ec39e47bd63088d9129dd2a53c401be Mon Sep 17 00:00:00 2001 From: bgy <1322446236@qq.com> Date: Sat, 14 Sep 2024 18:35:25 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=88=90=E6=9C=AC?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91=E8=BF=9B=E8=A1=8C=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/plugin/StandardCostService.java | 12 +--- .../impl/AppSceneCostCountServiceImpl.java | 69 +++++++++++++++---- 2 files changed, 57 insertions(+), 24 deletions(-) diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java index 1f5fd9a..6e5e59d 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java @@ -110,15 +110,7 @@ public class StandardCostService { //1.查询出所有满足物料编号的物料(BOM物料) String sql = flowTaskInfoVO.getSqlString(); log.info("传递过来的SQL语句:" + sql); - //TODO 查询最顶部的BOM物料编号下所有的物料并进行层级排序 - List list = standardCostService.costMaterialBomService.queryAllBomInfoBytopMaterialCode(topMaterialCode); - log.info("Full EmptyTask list: {}", list); - //2.把查询的结果存放在临时表里(表命名规则:前缀_流程id_组件code) - for (int i = 0; list != null && i < list.size(); i++) { - AppSceneCostMaterialBom material = list.get(i); - AppSceneCostResultValue appSceneCostResultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(material.getMaterialCode()).parentMarterialNo(material.getParentMaterialCode()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).num(material.getNumber()).build(); - standardCostService.iAppSceneCostResultValueService.save(appSceneCostResultValue); - } + } catch (Exception e) { throw new RuntimeException(e); } @@ -478,7 +470,7 @@ public class StandardCostService { //获取最上层的物料号 String topMaterialCode = flowTaskInfoVO.getTopMaterialCode(); //获取任务类型 - String taskType = parameters.getTaksType(); + String taskType = parameters.getTaskType(); //获取任务代码 String taskCode = flowTaskInfoVO.getTaskCode(); //获取流程id 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 52198a1..b90efaf 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 @@ -1,19 +1,23 @@ package com.zzsmart.qomo.kn.cost.manage.service.impl; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; 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.dao.entity.FlowInstance; +import com.zzsmart.qomo.dao.entity.FlowInstanceParameter; 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; import com.zzsmart.qomo.kn.cost.manage.enums.CostCountStatusEnum; import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostCountMapper; import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPartMissingInfoMapper; +import com.zzsmart.qomo.kn.cost.manage.plugin.StandardCostService; 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 com.zzsmart.qomo.service.IFlowInstanceParameterService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -34,7 +38,11 @@ public class AppSceneCostCountServiceImpl extends ServiceImpl Date: Tue, 17 Sep 2024 00:02:37 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=87=E5=87=86?= =?UTF-8?q?=E6=88=90=E6=9C=AC=E8=AE=A1=E7=AE=97=E5=8A=9F=E8=83=BD=E3=80=82?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=87=E5=87=86=E6=88=90=E6=9C=AC=E5=8D=95?= =?UTF-8?q?=E8=A1=8C=E6=9F=A5=E8=AF=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yml | 4 +- .../AppSceneCostCountController.java | 2 +- .../AppSceneCostMaterialBomController.java | 190 ----- ...eneCostMaterialProcessHoursController.java | 159 ---- .../AppSceneCostPurchasePriceController.java | 159 ---- ...AppSceneCostStandardResultController.java} | 22 +- .../entity/AppSceneCostMaterialBom.java | 261 ------ .../AppSceneCostMaterialProcessHours.java | 129 --- ...AppSceneCostProductProcessMaintenance.java | 4 +- .../entity/AppSceneCostPurchasePrice.java | 173 ---- .../entity/AppSceneCostResultValue.java | 4 +- .../entity/AppSceneCostStandardResult.java | 365 +++++++++ .../AppSceneCostBomRelevancyMapper.java | 29 +- .../mapper/AppSceneCostHourRateMapper.java | 3 + .../mapper/AppSceneCostMaterialBomMapper.java | 34 - ...ppSceneCostMaterialProcessHoursMapper.java | 14 - .../AppSceneCostPurchasePriceMapper.java | 14 - .../AppSceneCostStandardResultMapper.java | 15 + .../xml/AppSceneCostBomRelevancyMapper.xml | 2 +- .../xml/AppSceneCostMaterialBomMapper.xml | 5 - ...AppSceneCostMaterialProcessHoursMapper.xml | 5 - ...l => AppSceneCostStandardResultMapper.xml} | 2 +- .../manage/plugin/StandardCostService.java | 741 ++++++++++-------- .../IAppSceneCostBomRelevancyService.java | 15 + .../service/IAppSceneCostCountService.java | 3 +- .../service/IAppSceneCostHourRateService.java | 7 +- .../IAppSceneCostMaterialBomService.java | 28 - ...pSceneCostMaterialProcessHoursService.java | 22 - ...eCostProductProcessMaintenanceService.java | 9 +- .../IAppSceneCostPurchasePriceService.java | 22 - .../IAppSceneCostPurchaseRecordService.java | 8 + .../IAppSceneCostStandardResultService.java | 14 + .../AppSceneCostBomRelevancyServiceImpl.java | 43 +- .../impl/AppSceneCostCountServiceImpl.java | 36 +- .../impl/AppSceneCostHourRateServiceImpl.java | 27 + .../AppSceneCostMaterialBomServiceImpl.java | 60 -- ...neCostMaterialProcessHoursServiceImpl.java | 55 -- ...tProductProcessMaintenanceServiceImpl.java | 42 +- .../AppSceneCostPurchasePriceServiceImpl.java | 47 -- ...AppSceneCostPurchaseRecordServiceImpl.java | 28 + .../AppSceneCostResultValueServiceImpl.java | 10 +- ...AppSceneCostStandardResultServiceImpl.java | 21 + .../cost/manage/vo/AppSceneCostCountVO.java | 58 +- .../cost/manage/vo/CostModelDefinitionVO.java | 1 - 44 files changed, 1137 insertions(+), 1755 deletions(-) delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialBomController.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialProcessHoursController.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java rename qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/{AppSceneCostStandardDetailController.java => AppSceneCostStandardResultController.java} (86%) delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostMaterialBom.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostMaterialProcessHours.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostPurchasePrice.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostStandardResult.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialBomMapper.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialProcessHoursMapper.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchasePriceMapper.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardResultMapper.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialBomMapper.xml delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialProcessHoursMapper.xml rename qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/{AppSceneCostPurchasePriceMapper.xml => AppSceneCostStandardResultMapper.xml} (88%) delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialBomService.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialProcessHoursService.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchasePriceService.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostStandardResultService.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialBomServiceImpl.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialProcessHoursServiceImpl.java delete mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchasePriceServiceImpl.java create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostStandardResultServiceImpl.java 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 121138b..d5f57ae 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 @@ -296,8 +296,8 @@ jeecg: #webapp文件路径 webapp: /opt/webapp shiro: - excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/** - # excludeUrls: /**/**,/**/**/** +# excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/** + excludeUrls: /**/**,/**/**/** #阿里云oss存储和大鱼短信秘钥配置 oss: 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 6c021b0..86b6ec5 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 @@ -81,7 +81,7 @@ public class AppSceneCostCountController extends JeecgController addCostCountTask(@RequestBody AppSceneCostCount appSceneCostCount) { + public Result addCostCountTask(@RequestBody AppSceneCostCountVO appSceneCostCount) { appSceneCostCountService.addCostCountTask(appSceneCostCount); return Result.OK("添加成功!"); } 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 deleted file mode 100644 index 6cc8480..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialBomController.java +++ /dev/null @@ -1,190 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialBom; -import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostMaterialBomService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.system.base.controller.JeecgController; -import org.jeecg.common.system.query.QueryGenerator; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * @Description: app_scene_cost_material_bom - * @Author: jeecg-boot - * @Date: 2024-08-02 - * @Version: V1.0 - */ -@RequestMapping("//cost-material-bom") -@Api(tags="cost-标准成本-bom信息") -@RestController -@Slf4j -public class AppSceneCostMaterialBomController extends JeecgController { - @Autowired - private IAppSceneCostMaterialBomService costMaterialBomService; - /** - * 分页列表查询 - * - * @param costMaterialBom - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "app_scene_cost_standard_version-分页列表查询") - @ApiOperation(value="物料bom分页列表查询", notes="物料bom分页列表查询") - @GetMapping(value = "/pageList") - public Result> queryPageList(AppSceneCostMaterialBom costMaterialBom, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(costMaterialBom, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = costMaterialBomService.page(page, queryWrapper); - return Result.OK(pageList); - } - /** - * 列表查询 - * - * @return - */ - @ApiOperation(value="物料bom列表查询", notes="物料bom列表查询") - @GetMapping(value = "/list") - public Result> queryList(@RequestParam(name = "materialNumber",required = false) String materialNumber) { - List list = costMaterialBomService.queryListResult(materialNumber); - return Result.OK(list); - } - -// /** -// * 分页列表查询 -// * -// * @param appSceneCostMaterialBom -// * @param pageNo -// * @param pageSize -// * @param req -// * @return -// */ -// //@AutoLog(value = "app_scene_cost_material_bom-分页列表查询") -// @ApiOperation(value = "app_scene_cost_material_bom-分页列表查询", notes = "app_scene_cost_material_bom-分页列表查询") -// @GetMapping(value = "/list") -// public Result> queryPageList(AppSceneCostMaterialBom appSceneCostMaterialBom, -// @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, -// @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, -// HttpServletRequest req) { -// QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostMaterialBom, req.getParameterMap()); -// Page page = new Page(pageNo, pageSize); -// IPage pageList = appSceneCostMaterialBomService.page(page, queryWrapper); -// return Result.OK(pageList); -// } -// -// /** -// * 添加 -// * -// * @param appSceneCostMaterialBom -// * @return -// */ -// @AutoLog(value = "app_scene_cost_material_bom-添加") -// @ApiOperation(value = "app_scene_cost_material_bom-添加", notes = "app_scene_cost_material_bom-添加") -// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:add") -// @PostMapping(value = "/add") -// public Result add(@RequestBody AppSceneCostMaterialBom appSceneCostMaterialBom) { -// appSceneCostMaterialBomService.save(appSceneCostMaterialBom); -// return Result.OK("添加成功!"); -// } -// -// /** -// * 编辑 -// * -// * @param appSceneCostMaterialBom -// * @return -// */ -// @AutoLog(value = "app_scene_cost_material_bom-编辑") -// @ApiOperation(value = "app_scene_cost_material_bom-编辑", notes = "app_scene_cost_material_bom-编辑") -// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:edit") -// @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) -// public Result edit(@RequestBody AppSceneCostMaterialBom appSceneCostMaterialBom) { -// appSceneCostMaterialBomService.updateById(appSceneCostMaterialBom); -// return Result.OK("编辑成功!"); -// } -// -// /** -// * 通过id删除 -// * -// * @param id -// * @return -// */ -// @AutoLog(value = "app_scene_cost_material_bom-通过id删除") -// @ApiOperation(value = "app_scene_cost_material_bom-通过id删除", notes = "app_scene_cost_material_bom-通过id删除") -// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:delete") -// @DeleteMapping(value = "/delete") -// public Result delete(@RequestParam(name = "id", required = true) String id) { -// appSceneCostMaterialBomService.removeById(id); -// return Result.OK("删除成功!"); -// } -// -// /** -// * 批量删除 -// * -// * @param ids -// * @return -// */ -// @AutoLog(value = "app_scene_cost_material_bom-批量删除") -// @ApiOperation(value = "app_scene_cost_material_bom-批量删除", notes = "app_scene_cost_material_bom-批量删除") -// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:deleteBatch") -// @DeleteMapping(value = "/deleteBatch") -// public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { -// this.appSceneCostMaterialBomService.removeByIds(Arrays.asList(ids.split(","))); -// return Result.OK("批量删除成功!"); -// } -// -// /** -// * 通过id查询 -// * -// * @param id -// * @return -// */ -// //@AutoLog(value = "app_scene_cost_material_bom-通过id查询") -// @ApiOperation(value = "app_scene_cost_material_bom-通过id查询", notes = "app_scene_cost_material_bom-通过id查询") -// @GetMapping(value = "/queryById") -// public Result queryById(@RequestParam(name = "id", required = true) String id) { -// AppSceneCostMaterialBom appSceneCostMaterialBom = appSceneCostMaterialBomService.getById(id); -// if (appSceneCostMaterialBom == null) { -// return Result.error("未找到对应数据"); -// } -// return Result.OK(appSceneCostMaterialBom); -// } -// -// /** -// * 导出excel -// * -// * @param request -// * @param appSceneCostMaterialBom -// */ -// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:exportXls") -// @RequestMapping(value = "/exportXls") -// public ModelAndView exportXls(HttpServletRequest request, AppSceneCostMaterialBom appSceneCostMaterialBom) { -// return super.exportXls(request, appSceneCostMaterialBom, AppSceneCostMaterialBom.class, "app_scene_cost_material_bom"); -// } -// -// /** -// * 通过excel导入数据 -// * -// * @param request -// * @param response -// * @return -// */ -// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:importExcel") -// @RequestMapping(value = "/importExcel", method = RequestMethod.POST) -// public Result 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 deleted file mode 100644 index ea838e4..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostMaterialProcessHoursController.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialProcessHours; -import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostMaterialProcessHoursService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.aspect.annotation.AutoLog; -import org.jeecg.common.system.base.controller.JeecgController; -import org.jeecg.common.system.query.QueryGenerator; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.Arrays; - -/** - * @Description: app_scene_cost_material_process_hours - * @Author: jeecg-boot - * @Date: 2024-08-02 - * @Version: V1.0 - */ -@Api(tags = "cost-工序工时") -@RestController -@RequestMapping("//processHours") -@Slf4j -public class AppSceneCostMaterialProcessHoursController extends JeecgController { - @Autowired - private IAppSceneCostMaterialProcessHoursService appSceneCostMaterialProcessHoursService; - - /** - * 分页列表查询 - * - * @param appSceneCostMaterialProcessHours - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "app_scene_cost_material_process_hours-分页列表查询") - @ApiOperation(value = "app_scene_cost_material_process_hours-分页列表查询", notes = "app_scene_cost_material_process_hours-分页列表查询") - @GetMapping(value = "/list") - public Result> queryPageList(AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostMaterialProcessHours, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = appSceneCostMaterialProcessHoursService.page(page, queryWrapper); - return Result.OK(pageList); - } - - /** - * 添加 - * - * @param appSceneCostMaterialProcessHours - * @return - */ - @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") - @PostMapping(value = "/add") - public Result add(@RequestBody AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours) { - appSceneCostMaterialProcessHoursService.save(appSceneCostMaterialProcessHours); - return Result.OK("添加成功!"); - } - - /** - * 编辑 - * - * @param appSceneCostMaterialProcessHours - * @return - */ - @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") - @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) - public Result edit(@RequestBody AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours) { - appSceneCostMaterialProcessHoursService.updateById(appSceneCostMaterialProcessHours); - return Result.OK("编辑成功!"); - } - - /** - * 通过id删除 - * - * @param id - * @return - */ - @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") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name = "id", required = true) String id) { - appSceneCostMaterialProcessHoursService.removeById(id); - return Result.OK("删除成功!"); - } - -// /** -// * 批量删除 -// * -// * @param ids -// * @return -// */ -// @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") -// @DeleteMapping(value = "/deleteBatch") -// public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { -// this.appSceneCostMaterialProcessHoursService.removeByIds(Arrays.asList(ids.split(","))); -// return Result.OK("批量删除成功!"); -// } - - /** - * 通过id查询 - * - * @param id - * @return - */ - //@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查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name = "id", required = true) String id) { - AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours = appSceneCostMaterialProcessHoursService.getById(id); - if (appSceneCostMaterialProcessHours == null) { - return Result.error("未找到对应数据"); - } - return Result.OK(appSceneCostMaterialProcessHours); - } - -// /** -// * 导出excel -// * -// * @param request -// * @param appSceneCostMaterialProcessHours -// */ -// //@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"); -// } - -// /** -// * 通过excel导入数据 -// * -// * @param request -// * @param response -// * @return -// */ -// //@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/AppSceneCostPurchasePriceController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java deleted file mode 100644 index 1bfe828..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostPurchasePriceController.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchasePrice; -import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchasePriceService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.aspect.annotation.AutoLog; -import org.jeecg.common.system.base.controller.JeecgController; -import org.jeecg.common.system.query.QueryGenerator; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import java.util.Arrays; - -/** - * @Description: app_scene_cost_purchase_price - * @Author: jeecg-boot - * @Date: 2024-08-02 - * @Version: V1.0 - */ -@Api(tags = "cost-采购价") -@RestController -@RequestMapping("//purchasePrice") -@Slf4j -public class AppSceneCostPurchasePriceController extends JeecgController { - @Autowired - private IAppSceneCostPurchasePriceService appSceneCostPurchasePriceService; - - /** - * 分页列表查询 - * - * @param appSceneCostPurchasePrice - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "app_scene_cost_purchase_price-分页列表查询") - @ApiOperation(value = "app_scene_cost_purchase_price-分页列表查询", notes = "app_scene_cost_purchase_price-分页列表查询") - @GetMapping(value = "/list") - public Result> queryPageList(AppSceneCostPurchasePrice appSceneCostPurchasePrice, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostPurchasePrice, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = appSceneCostPurchasePriceService.page(page, queryWrapper); - return Result.OK(pageList); - } - - /** - * 添加 - * - * @param appSceneCostPurchasePrice - * @return - */ - @AutoLog(value = "app_scene_cost_purchase_price-添加") - @ApiOperation(value = "app_scene_cost_purchase_price-添加", notes = "app_scene_cost_purchase_price-添加") - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:add") - @PostMapping(value = "/add") - public Result add(@RequestBody AppSceneCostPurchasePrice appSceneCostPurchasePrice) { - appSceneCostPurchasePriceService.save(appSceneCostPurchasePrice); - return Result.OK("添加成功!"); - } - - /** - * 编辑 - * - * @param appSceneCostPurchasePrice - * @return - */ - @AutoLog(value = "app_scene_cost_purchase_price-编辑") - @ApiOperation(value = "app_scene_cost_purchase_price-编辑", notes = "app_scene_cost_purchase_price-编辑") - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:edit") - @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) - public Result edit(@RequestBody AppSceneCostPurchasePrice appSceneCostPurchasePrice) { - appSceneCostPurchasePriceService.updateById(appSceneCostPurchasePrice); - return Result.OK("编辑成功!"); - } - - /** - * 通过id删除 - * - * @param id - * @return - */ - @AutoLog(value = "app_scene_cost_purchase_price-通过id删除") - @ApiOperation(value = "app_scene_cost_purchase_price-通过id删除", notes = "app_scene_cost_purchase_price-通过id删除") - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:delete") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name = "id", required = true) String id) { - appSceneCostPurchasePriceService.removeById(id); - return Result.OK("删除成功!"); - } - - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "app_scene_cost_purchase_price-批量删除") - @ApiOperation(value = "app_scene_cost_purchase_price-批量删除", notes = "app_scene_cost_purchase_price-批量删除") - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:deleteBatch") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { - this.appSceneCostPurchasePriceService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - //@AutoLog(value = "app_scene_cost_purchase_price-通过id查询") - @ApiOperation(value = "app_scene_cost_purchase_price-通过id查询", notes = "app_scene_cost_purchase_price-通过id查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name = "id", required = true) String id) { - AppSceneCostPurchasePrice appSceneCostPurchasePrice = appSceneCostPurchasePriceService.getById(id); - if (appSceneCostPurchasePrice == null) { - return Result.error("未找到对应数据"); - } - return Result.OK(appSceneCostPurchasePrice); - } - - /** - * 导出excel - * - * @param request - * @param appSceneCostPurchasePrice - */ - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:exportXls") - @RequestMapping(value = "/exportXls") - public ModelAndView exportXls(HttpServletRequest request, AppSceneCostPurchasePrice appSceneCostPurchasePrice) { - return super.exportXls(request, appSceneCostPurchasePrice, AppSceneCostPurchasePrice.class, "app_scene_cost_purchase_price"); - } - - /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:importExcel") - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result 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/AppSceneCostStandardDetailController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardResultController.java similarity index 86% rename from qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardDetailController.java rename to qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardResultController.java index b8baada..4cb2fa3 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/AppSceneCostStandardResultController.java @@ -4,11 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardDetail; -import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardDetailService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardResult; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardResultService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; -import org.apache.shiro.authz.annotation.RequiresPermissions; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; @@ -31,14 +31,14 @@ import javax.servlet.http.HttpServletRequest; @RestController @RequestMapping("//costStandardDetail") @Slf4j -public class AppSceneCostStandardDetailController extends JeecgController { +public class AppSceneCostStandardResultController extends JeecgController { @Autowired - private IAppSceneCostStandardDetailService appSceneCostStandardDetailService; + private IAppSceneCostStandardResultService appSceneCostStandardResultService; /** * 分页列表查询 * - * @param appSceneCostStandardDetail + * @param appSceneCostStandardResult * @param pageNo * @param pageSize * @param req @@ -47,10 +47,10 @@ public class AppSceneCostStandardDetailController extends JeecgController> queryPageList(AppSceneCostStandardDetail appSceneCostStandardDetail, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostStandardDetail, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = appSceneCostStandardDetailService.page(page, queryWrapper); + public Result> queryPageList(AppSceneCostStandardResult appSceneCostStandardResult, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostStandardResult, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appSceneCostStandardResultService.page(page, queryWrapper); return Result.OK(pageList); } // @@ -140,8 +140,8 @@ public class AppSceneCostStandardDetailController extends JeecgController { + @Select("WITH RECURSIVE BOM_Tree AS (\n" + + " SELECT matnr, idnrk, meins, 0 AS depth\n" + + " FROM app_scene_cost_bom_relevancy\n" + + " WHERE matnr = #{parentId}\n" + + " UNION ALL\n" + + " SELECT b.matnr, b.idnrk, b.meins, BOM_Tree.depth + 1\n" + + " FROM app_scene_cost_bom_relevancy b\n" + + " JOIN BOM_Tree ON b.matnr = BOM_Tree.idnrk\n" + + ")\n" + + "SELECT matnr, idnrk, meins, depth FROM BOM_Tree") + List findChildrenByParentId(String parentId); + + + @Select("${selectSql}") + JSONObject customSelectOne(@Param("selectSql") String selectSql); + + @Select("${SelectBlobModel}") + String customSelectBlobModelJson(@Param("SelectBlobModel") String SelectBlobModel); + } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostHourRateMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostHourRateMapper.java index 97b285d..469d9a0 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostHourRateMapper.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostHourRateMapper.java @@ -1,7 +1,10 @@ package com.zzsmart.qomo.kn.cost.manage.mapper; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostHourRate; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; /** * @Description: app_scene_cost_hour_rate diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialBomMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialBomMapper.java deleted file mode 100644 index 2de786a..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialBomMapper.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.mapper; - -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialBom; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; - -import java.util.List; - -/** - * @Description: app_scene_cost_material_bom - * @Author: jeecg-boot - * @Date: 2024-08-02 - * @Version: V1.0 - */ -public interface AppSceneCostMaterialBomMapper extends BaseMapper { - /** - * 根据动态SQL语句查询物料BOM表 - * - * @param selectCommand - * @return - */ - @Select("${selectCommand}") - List customSelect(@Param("selectCommand") String selectCommand); - - - @Select("${selectSql}") - JSONObject customSelectOne(@Param("selectSql") String selectSql); - - @Select("${SelectBlobModel}") - String customSelectBlobModelJson(@Param("SelectBlobModel") String SelectBlobModel); - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialProcessHoursMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialProcessHoursMapper.java deleted file mode 100644 index cc08037..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostMaterialProcessHoursMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialProcessHours; - -/** - * @Description: app_scene_cost_material_process_hours - * @Author: jeecg-boot - * @Date: 2024-08-02 - * @Version: V1.0 - */ -public interface AppSceneCostMaterialProcessHoursMapper extends BaseMapper { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchasePriceMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchasePriceMapper.java deleted file mode 100644 index 6914312..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostPurchasePriceMapper.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.mapper; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchasePrice; - -/** - * @Description: app_scene_cost_purchase_price - * @Author: jeecg-boot - * @Date: 2024-08-02 - * @Version: V1.0 - */ -public interface AppSceneCostPurchasePriceMapper extends BaseMapper { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardResultMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardResultMapper.java new file mode 100644 index 0000000..ddfeca6 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostStandardResultMapper.java @@ -0,0 +1,15 @@ +package com.zzsmart.qomo.kn.cost.manage.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardResult; + +/** + * @Description: app_scene_cost_standard_detail + * @Author: jeecg-boot + * @Date: 2024-07-31 + * @Version: V1.0 + */ +public interface AppSceneCostStandardResultMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostBomRelevancyMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostBomRelevancyMapper.xml index 4d8a366..5d21763 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostBomRelevancyMapper.xml +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostBomRelevancyMapper.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialBomMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialBomMapper.xml deleted file mode 100644 index 23d4a07..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialBomMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialProcessHoursMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialProcessHoursMapper.xml deleted file mode 100644 index f86ee8c..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostMaterialProcessHoursMapper.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchasePriceMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardResultMapper.xml similarity index 88% rename from qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchasePriceMapper.xml rename to qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardResultMapper.xml index 6571f46..5d66ca3 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostPurchasePriceMapper.xml +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostStandardResultMapper.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java index 6e5e59d..eeb35e2 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java @@ -6,7 +6,7 @@ import com.zzsmart.qomo.kn.cost.manage.entity.*; import com.zzsmart.qomo.kn.cost.manage.enums.FeeTypeEnum; import com.zzsmart.qomo.kn.cost.manage.enums.HourOrRateTypeEnum; import com.zzsmart.qomo.kn.cost.manage.enums.TotalCostEnum; -import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostMaterialBomMapper; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostBomRelevancyMapper; import com.zzsmart.qomo.kn.cost.manage.service.*; import com.zzsmart.qomo.kn.cost.manage.vo.FlowTaskInfoVO; import com.zzsmart.qomo.kn.cost.manage.vo.TotalResultValue; @@ -32,9 +32,9 @@ public class StandardCostService { * 物料BOM信息 */ @Autowired - AppSceneCostMaterialBomMapper costMaterialBomMapper; + AppSceneCostBomRelevancyMapper appSceneCostBomRelevancyMapper; @Autowired - IAppSceneCostMaterialBomService costMaterialBomService; + IAppSceneCostBomRelevancyService costMaterialBomService; /** * 小时费率 @@ -45,12 +45,12 @@ public class StandardCostService { * 采购单价 */ @Autowired - IAppSceneCostPurchasePriceService costPurchasePriceService; + IAppSceneCostPurchaseRecordService costPurchaseRecordService; /** * 工序 */ @Autowired - IAppSceneCostMaterialProcessHoursService costMaterialProcessHoursService; + IAppSceneCostProductProcessMaintenanceService costMaterialProcessHoursService; /** * 标准成本计算结果 */ @@ -69,19 +69,19 @@ public class StandardCostService { * 标准成本明细服务(单行查询服务) */ @Autowired - private IAppSceneCostStandardDetailService iAppSceneCostStandardDetailService; + private IAppSceneCostStandardResultService iAppSceneCostStandardResultService; @PostConstruct public void init() { standardCostService = this; - standardCostService.costMaterialBomMapper = this.costMaterialBomMapper; + standardCostService.appSceneCostBomRelevancyMapper = this.appSceneCostBomRelevancyMapper; standardCostService.appSceneCostCountService = this.appSceneCostCountService; standardCostService.costMaterialBomService = this.costMaterialBomService; - standardCostService.costPurchasePriceService = this.costPurchasePriceService; + standardCostService.costPurchaseRecordService = this.costPurchaseRecordService; standardCostService.iHourRateService = this.iHourRateService; standardCostService.costMaterialProcessHoursService = this.costMaterialProcessHoursService; standardCostService.iAppSceneCostResultValueService = this.iAppSceneCostResultValueService; - standardCostService.iAppSceneCostStandardDetailService = this.iAppSceneCostStandardDetailService; + standardCostService.iAppSceneCostStandardResultService = this.iAppSceneCostStandardResultService; } /** @@ -110,12 +110,400 @@ public class StandardCostService { //1.查询出所有满足物料编号的物料(BOM物料) String sql = flowTaskInfoVO.getSqlString(); log.info("传递过来的SQL语句:" + sql); - + //获取顶部物料下所有的物料信息并存储到新的表中 + getAllMaterialBomInfoByTopMaterialCode(topMaterialCode, taskType, taskCode, flowInstanceId != null ? Integer.valueOf(flowInstanceId) : null); } catch (Exception e) { throw new RuntimeException(e); } } + /** + * 【1.成本参数查询】查询最顶部的BOM物料编号下所有的物料并进行层级排序 + * * 获取顶部物料下所有的物料信息并存储到新的表中 + * + * @param topMaterialCode 顶部物料编号 + * @param taskType 任务类型 + * @param taskCode 任务编号 + * @param flowInstanceId 流程实例id + */ + public static void getAllMaterialBomInfoByTopMaterialCode(String topMaterialCode, String taskType, String taskCode, Integer flowInstanceId) { + List list = standardCostService.costMaterialBomService.queryAllBomInfoByTopMaterialCode(topMaterialCode); + log.info("Full ParamTask list: {}", list); + //TODO material.getMeins()领用量??为什么是ST字母 + for (int i = 0; list != null && i < list.size(); i++) { + AppSceneCostBomRelevancy material = list.get(i); + //TODO 物料领用数据 + BigDecimal num1 = BigDecimal.ONE; + AppSceneCostResultValue appSceneCostResultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(material.getIdnrk()).parentMarterialNo(material.getMatnr()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).num(num1).build(); + standardCostService.iAppSceneCostResultValueService.save(appSceneCostResultValue); + } + } + + /** + * 【2.物料成本计算】计算物料成本 + * + * @param topMaterialCode 顶部物料编号 + * @param taskType 任务类型 + * @param taskCode 任务编号 + * @param flowInstanceId 流程实例id + */ + public static void countMaterialCostByTopMaterialCode(String topMaterialCode, String taskType, String taskCode, Integer flowInstanceId, String feeType) { + //1.查询出物料编号对应的下所有的BOM信息 + List list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", String.valueOf(flowInstanceId)); + //2.计算出所有的单个物料的物料成本 + //2.1查询出物料的单价和采购数量 + List MarterialNoList = new ArrayList<>(); + if (list != null && list.size() > 0) { + MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList()); + } + //查询物料的采购价 + Map purchasePriceMap = standardCostService.costPurchaseRecordService.getMinCostPurchasePriceByMaterialNo(MarterialNoList); + for (int i = 0; i < list.size(); i++) { + AppSceneCostResultValue appSceneCostResultValue = list.get(i); + String marterialNo = appSceneCostResultValue.getMarterialNo(); + BigDecimal num = appSceneCostResultValue.getNum(); + if (marterialNo != null && num != null && (new BigDecimal(num.toString()).compareTo(BigDecimal.ZERO)) != 0) { + BigDecimal price = purchasePriceMap.get(marterialNo); + if (price == null) { + price = BigDecimal.ZERO; + } + BigDecimal number = new BigDecimal(num.toString()); + //单价乘以数量 + BigDecimal totalCost = price.multiply(number); + //2.2计算出人工成本并存储到成本结果数据表中 + AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).costType(feeType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").priceOrRate(price).num(num).build(); + standardCostService.iAppSceneCostResultValueService.save(resultValue); + } + } + } + + /** + * 【3.人工成本计算】 + * + * @param topMaterialCode 顶部物料编号 + * @param taskType 任务类型 + * @param taskCode 任务编号 + * @param flowInstanceId 流程实例id + */ + public static void countLaborCostByTopMaterialCode(String topMaterialCode, String taskType, String taskCode, Integer flowInstanceId, String feeType, AppSceneCostHourRate appSceneCostHourRate) { + //1.查询出人员工时费率 + AppSceneCostHourRate hourRateInfo = standardCostService.iHourRateService.getOneHourRateInfo(appSceneCostHourRate); + BigDecimal hourRate = new BigDecimal("0"); + if (hourRateInfo != null) { + hourRate = hourRateInfo.getLaborHourRate(); + } + //1.查询出物料编号对应的下所有的BOM信息 + List list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", String.valueOf(flowInstanceId)); + //2.计算出所有的单个物料的人工成本 + //2.1查询出物料的人员工时和人工小时费率(涉及:小时费率表和工序表) + List MarterialNoList = new ArrayList<>(); + if (list != null && list.size() > 0) { + MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList()); + } + //查询工序工时 + Map> processHoursMap = standardCostService.costMaterialProcessHoursService.getProcessHoursByMaterialNo(MarterialNoList); + for (int i = 0; i < list.size(); i++) { + AppSceneCostResultValue appSceneCostResultValue = list.get(i); + String marterialNo = appSceneCostResultValue.getMarterialNo(); + if (marterialNo != null) { + BigDecimal totalCost = new BigDecimal("0.0"); + BigDecimal laborHours = new BigDecimal("0.0"); + List costMaterialProcessHours = processHoursMap.get(marterialNo); + if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { + for (int j = 0; j < costMaterialProcessHours.size(); j++) { + AppSceneCostProductProcessMaintenance processHours = costMaterialProcessHours.get(j); + laborHours = laborHours.add(processHours.getLaborHour()); + //计算总人工成本 + totalCost = totalCost.add(processHours.getLaborHour().multiply(hourRate)); + } + } + //2.2计算出人工成本并存储到成本结果数据表中 + AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(Integer.valueOf(flowInstanceId)).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build(); + standardCostService.iAppSceneCostResultValueService.save(resultValue); + } + } + } + + /** + * 【4.制造费用】 + * + * @param topMaterialCode 顶部物料编号 + * @param taskType 任务类型 + * @param taskCode 任务编号 + * @param flowInstanceId 流程实例id + */ + public static void countManufacturingCostByTopMaterialCode(String topMaterialCode, String taskType, String taskCode, Integer flowInstanceId, String feeType, AppSceneCostHourRate appSceneCostHourRate) { + //1.查询出人员工时费率 + AppSceneCostHourRate hourRateInfo = standardCostService.iHourRateService.getOneHourRateInfo(appSceneCostHourRate); + BigDecimal hourRate = new BigDecimal("0"); + if (hourRateInfo != null) { + hourRate = hourRateInfo.getLaborHourRate(); + } + //1.查询出物料编号对应的下所有的BOM信息 + List list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", String.valueOf(flowInstanceId)); + //2.根据费用类型进行不同的费用计算 + //查询工序工时 + List MarterialNoList = new ArrayList<>(); + if (list != null && list.size() > 0) { + MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList()); + } + Map> processHoursMap = standardCostService.costMaterialProcessHoursService.getProcessHoursByMaterialNo(MarterialNoList); + //2.1机器折旧费(机器工时*费率) + if (FeeTypeEnum.EquipmentFee.getCode().equals(feeType)) { + for (int i = 0; i < list.size(); i++) { + AppSceneCostResultValue appSceneCostResultValue = list.get(i); + String marterialNo = appSceneCostResultValue.getMarterialNo(); + if (marterialNo != null) { + BigDecimal totalCost = new BigDecimal("0.0"); + BigDecimal laborHours = new BigDecimal("0.0"); + List costMaterialProcessHours = processHoursMap.get(marterialNo); + if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { + for (int j = 0; j < costMaterialProcessHours.size(); j++) { + AppSceneCostProductProcessMaintenance processHours = costMaterialProcessHours.get(j); + laborHours = laborHours.add(processHours.getMachineHour()); + //计算机器成本 + totalCost = totalCost.add(processHours.getMachineHour().multiply(hourRate)); + } + } + //2.2计算机器成本并存储到成本结果数据表中 + AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(Integer.valueOf(flowInstanceId)).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build(); + standardCostService.iAppSceneCostResultValueService.save(resultValue); + } + } + } else if (FeeTypeEnum.SupplyMaterialFee.getCode().equals(feeType)) { + //机物料消耗(辅料工时*费率) + for (int i = 0; i < list.size(); i++) { + AppSceneCostResultValue appSceneCostResultValue = list.get(i); + String marterialNo = appSceneCostResultValue.getMarterialNo(); + if (marterialNo != null) { + BigDecimal totalCost = new BigDecimal("0.0"); + BigDecimal laborHours = new BigDecimal("0.0"); + List costMaterialProcessHours = processHoursMap.get(marterialNo); + if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { + for (int j = 0; j < costMaterialProcessHours.size(); j++) { + AppSceneCostProductProcessMaintenance processHours = costMaterialProcessHours.get(j); + //辅料工时 + laborHours = laborHours.add(processHours.getAuxiliaryHour()); + //机物料消耗 + totalCost = totalCost.add(processHours.getAuxiliaryHour().multiply(hourRate)); + } + } + //2.2计算机物料消耗存储到成本结果数据表中 + AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(Integer.valueOf(flowInstanceId)).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build(); + standardCostService.iAppSceneCostResultValueService.save(resultValue); + } + } + } else if (FeeTypeEnum.DriverFee.getCode().equals(feeType)) { + //2.3水电费(燃动力工时*费率) + for (int i = 0; i < list.size(); i++) { + AppSceneCostResultValue appSceneCostResultValue = list.get(i); + String marterialNo = appSceneCostResultValue.getMarterialNo(); + if (marterialNo != null) { + BigDecimal totalCost = new BigDecimal("0.0"); + BigDecimal laborHours = new BigDecimal("0.0"); + List costMaterialProcessHours = processHoursMap.get(marterialNo); + if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { + for (int j = 0; j < costMaterialProcessHours.size(); j++) { + AppSceneCostProductProcessMaintenance processHours = costMaterialProcessHours.get(j); + //燃动力工时来源 + laborHours = laborHours.add(processHours.getBurningHour()); + //水电费(燃动力工时*费率)成本 + totalCost = totalCost.add(processHours.getBurningHour().multiply(hourRate)); + } + } + //2.2计算机物料消耗存储到成本结果数据表中 + AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(Integer.valueOf(flowInstanceId)).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build(); + standardCostService.iAppSceneCostResultValueService.save(resultValue); + } + } + } else if (FeeTypeEnum.OtherFee.getCode().equals(feeType)) { + //2.4其他制费(其他工时*费率) + for (int i = 0; i < list.size(); i++) { + AppSceneCostResultValue appSceneCostResultValue = list.get(i); + String marterialNo = appSceneCostResultValue.getMarterialNo(); + if (marterialNo != null) { + BigDecimal totalCost = new BigDecimal("0.0"); + BigDecimal laborHours = new BigDecimal("0.0"); + List costMaterialProcessHours = processHoursMap.get(marterialNo); + if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { + for (int j = 0; j < costMaterialProcessHours.size(); j++) { + AppSceneCostProductProcessMaintenance processHours = costMaterialProcessHours.get(j); + //其他工时来源 + laborHours = laborHours.add(processHours.getOtherHour()); + //其他制费成本 + totalCost = totalCost.add(processHours.getOtherHour().multiply(hourRate)); + } + } + //2.2计算机物料消耗存储到成本结果数据表中 + AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(Integer.valueOf(flowInstanceId)).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build(); + standardCostService.iAppSceneCostResultValueService.save(resultValue); + } + } + } else if (FeeTypeEnum.LogisticsFee.getCode().equals(feeType)) { + //查出所有的机器折旧费、机物料消耗、水电费、其他制费 + list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "ManufacturingCost", String.valueOf(flowInstanceId)); + //2.5物流费((机器折旧+机物料消耗+水电费+其他制费)*10.16%) + //按照物料编号进行分组 + Map> materialNoMap = list.stream().collect(Collectors.groupingBy(AppSceneCostResultValue::getMarterialNo)); + for (String key : materialNoMap.keySet()) { + List appSceneCostResultValues = materialNoMap.get(key); + BigDecimal totalCost = new BigDecimal("0.0"); + for (int j = 0; j < appSceneCostResultValues.size(); j++) { + AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValues.get(j); + String countValue = appSceneCostResultValue.getCountValue(); + if (countValue != null) { + totalCost = totalCost.add(new BigDecimal(countValue)); + } + } + AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(key).parentMarterialNo(appSceneCostResultValues.get(0).getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(Integer.valueOf(flowInstanceId)).countValue(totalCost.multiply(new BigDecimal("0.1016")).toString()).costType(feeType).build(); + standardCostService.iAppSceneCostResultValueService.save(resultValue); + } + } + } + + /** + * 【5.制造费用】 + * + * @param topMaterialCode 顶部物料编号 + * @param taskType 任务类型 + * @param taskCode 任务编号 + * @param flowInstanceId 流程实例id + * @param costType 流程实例id + */ + public static void countStandardCostByTopMaterialCode(String topMaterialCode, String taskType, String taskCode, Integer flowInstanceId, String costType, String versionNumber) { + //1.查询出根物料编号对应的下所有的BOM信息结果值 + List list = standardCostService.iAppSceneCostResultValueService.getAllResultValueByTopMaterialNo(topMaterialCode, String.valueOf(flowInstanceId)); + //2.计算出所有的单个物料的本阶的标准成本(标准成本=物料成本+人工成本+制造费用) + //按照物料编号进行分组 + Map> materialNoMap = list.stream().collect(Collectors.groupingBy(AppSceneCostResultValue::getMarterialNo)); + //遍历根物料下所有的物料进行该物料本阶成本和费用类别的统计 + for (String key : materialNoMap.keySet()) { + List appSceneCostResultValues = materialNoMap.get(key); + //按照费用类别进行分组 + Map> costTypeMap = appSceneCostResultValues.stream().filter(s -> s.getCostType() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getCostType)); + //【本阶标准成本】 + BigDecimal currentCost = new BigDecimal("0.0"); + //1.本阶物料成本 + BigDecimal materialCost = new BigDecimal("0.0"); + //2.本阶人工成本 + BigDecimal laborCost = new BigDecimal("0.0"); + //3.本阶制造费(设备费) + BigDecimal equipmentCost = new BigDecimal("0.0"); + //4.本阶制造费(辅料费用) + BigDecimal supplyMaterialCost = new BigDecimal("0.0"); + //5.本阶制造费(水电费、燃动费) + BigDecimal driveCost = new BigDecimal("0.0"); + //6.本阶制造费(其他制造费用) + BigDecimal otherCost = new BigDecimal("0.0"); + //7.本阶制造费(物流费) + BigDecimal logisticsCost = new BigDecimal("0.0"); + //物料单价 + BigDecimal materialUnitPrice = new BigDecimal("0.0"); + //人员工时、小时费率 + BigDecimal laborHour = new BigDecimal("0.0"); + BigDecimal laborHourRate = new BigDecimal("0.0"); + //设备工时、小时费率 + BigDecimal equipmentHour = new BigDecimal("0.0"); + BigDecimal equipmentHourRate = new BigDecimal("0.0"); + //辅料工时、小时费率 + BigDecimal supplyMaterialHour = new BigDecimal("0.0"); + BigDecimal supplyMaterialHourRate = new BigDecimal("0.0"); + //燃动工时、小时费率 + BigDecimal driveHour = new BigDecimal("0.0"); + BigDecimal driveHourRate = new BigDecimal("0.0"); + //其他工时、小时费率 + BigDecimal otherHour = new BigDecimal("0.0"); + BigDecimal otherHourRate = new BigDecimal("0.0"); + AppSceneCostResultValue currentMaterialCost = null; + //遍历所有费用类别计算本阶标准成本 + for (int j = 0; j < appSceneCostResultValues.size(); j++) { + if (j == 0) { + //初始化当前物料成本信息 + currentMaterialCost = appSceneCostResultValues.get(0); + } + AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValues.get(j); + String countValue = appSceneCostResultValue.getCountValue(); + if (countValue != null) { + currentCost = currentCost.add(new BigDecimal(countValue)); + } + } + //计算本阶各个费用类别费用以及记录本阶物料的工时和小时费率 + for (String feeType : costTypeMap.keySet()) { + List appSceneCostResultValues1 = costTypeMap.get(feeType); + for (int m = 0; m < appSceneCostResultValues1.size(); m++) { + if (FeeTypeEnum.MaterialCost.getCode().equals(feeType)) { + //物料成本 + materialCost = materialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //物料单价 + materialUnitPrice = appSceneCostResultValues1.get(m).getPriceOrRate(); + //TODO 数量 + currentMaterialCost.setNum(appSceneCostResultValues1.get(m).getNum()); + } else if (FeeTypeEnum.LaborCost.getCode().equals(feeType)) { + //人工成本 + laborCost = laborCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //人工工时、小时费率 + laborHour = laborHour.add(appSceneCostResultValues1.get(m).getHour()); + laborHourRate = laborHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); + } else if (FeeTypeEnum.EquipmentFee.getCode().equals(feeType)) { + //设备费用 + equipmentCost = equipmentCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //设备工时、小时费率 + equipmentHour = equipmentHour.add(appSceneCostResultValues1.get(m).getHour()); + equipmentHourRate = equipmentHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); + } else if (FeeTypeEnum.SupplyMaterialFee.getCode().equals(feeType)) { + //辅料费用 + supplyMaterialCost = supplyMaterialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //辅料工时、小时费率 + supplyMaterialHour = supplyMaterialHour.add(appSceneCostResultValues1.get(m).getHour()); + supplyMaterialHourRate = supplyMaterialHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); + } else if (FeeTypeEnum.DriverFee.getCode().equals(feeType)) { + //燃动费用 + driveCost = driveCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //燃动工时、小时费率 + driveHour = driveHour.add(appSceneCostResultValues1.get(m).getHour()); + driveHourRate = driveHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); + } else if (FeeTypeEnum.LogisticsFee.getCode().equals(feeType)) { + //物流费用 + logisticsCost = logisticsCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + } else if (FeeTypeEnum.OtherFee.getCode().equals(feeType)) { + //其他费用 + otherCost = otherCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); + //其他工时、小时费率 + otherHour = otherHour.add(appSceneCostResultValues1.get(m).getHour()); + otherHourRate = otherHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); + } + } + } + //本阶不同费用类别成本统计 + JSONObject currentLevelCostTypeDetail = new JSONObject(); + currentLevelCostTypeDetail.put(FeeTypeEnum.MaterialCost.getCode(), materialCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.LaborCost.getCode(), laborCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.EquipmentFee.getCode(), equipmentCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.SupplyMaterialFee.getCode(), supplyMaterialCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.DriverFee.getCode(), driveCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.LogisticsFee.getCode(), logisticsCost); + currentLevelCostTypeDetail.put(FeeTypeEnum.OtherFee.getCode(), otherCost); + //统计本阶不同费用类别工时、小时费率 + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.MaterialUnitPrice.getCode(), materialUnitPrice); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHour.getCode(), laborHour); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHourRate.getCode(), laborHourRate); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHour.getCode(), equipmentHour); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHourRate.getCode(), equipmentHourRate); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHour.getCode(), supplyMaterialHour); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHourRate.getCode(), supplyMaterialHourRate); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHour.getCode(), driveHour); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHourRate.getCode(), driveHourRate); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHour.getCode(), otherHour); + currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHourRate.getCode(), otherHourRate); + AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(key).parentMarterialNo(currentMaterialCost.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(Integer.valueOf(flowInstanceId)).countValue(currentCost.toString()).costDetail(JSON.toJSONString(currentLevelCostTypeDetail)).costType(costType).num(currentMaterialCost.getNum()).build(); + standardCostService.iAppSceneCostResultValueService.save(resultValue); + } + //3.计算出所有的单个物料的累计标准成本 + List standardCostList = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, taskType, String.valueOf(flowInstanceId)); + //【累计成本】的计算 + totalCountCost(standardCostList, topMaterialCode, taskType, taskCode, String.valueOf(flowInstanceId), versionNumber); + } + /** * 获取任务流程相关信息 * @@ -182,7 +570,7 @@ public class StandardCostService { */ private static FlowTaskInfoVO queryFlowDefinitionByFlowInstanceId(FlowTaskInfoVO flowTaskInfoVO) { String sql = "SELECT A.model_json from qomo_flow_definition as A LEFT JOIN qomo_flow_instance AS B ON A.`code`=B.flow_definition_code WHERE B.id=" + flowTaskInfoVO.getFlowInstanceId() + " limit 1"; - String blob = standardCostService.costMaterialBomMapper.customSelectBlobModelJson(sql); + String blob = standardCostService.appSceneCostBomRelevancyMapper.customSelectBlobModelJson(sql); if (blob != null) { if (blob != null && blob.contains("topMaterialCode")) { JSONObject jsonObject1 = JSON.parseObject(blob); @@ -210,30 +598,7 @@ public class StandardCostService { String flowInstanceId = flowTaskInfoVO.getFlowInstanceId(); //成本类型 String feeType = FeeTypeEnum.MaterialCost.getCode(); - //1.查询出物料编号对应的下所有的BOM信息 - List list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", flowInstanceId); - //2.计算出所有的单个物料的物料成本 - //2.1查询出物料的单价和采购数量 - List MarterialNoList = new ArrayList<>(); - if (list != null && list.size() > 0) { - MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList()); - } - //查询物料的采购价 - Map purchasePriceMap = standardCostService.costPurchasePriceService.getMinCostPurchasePriceByMaterialNo(MarterialNoList); - for (int i = 0; i < list.size(); i++) { - AppSceneCostResultValue appSceneCostResultValue = list.get(i); - String marterialNo = appSceneCostResultValue.getMarterialNo(); - Integer num = appSceneCostResultValue.getNum(); - if (marterialNo != null && num != null) { - BigDecimal price = purchasePriceMap.get(marterialNo); - BigDecimal number = new BigDecimal(num.toString()); - //单价乘以数量 - BigDecimal totalCost = price.multiply(number); - //2.2计算出人工成本并存储到成本结果数据表中 - AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).costType(feeType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").priceOrRate(price).build(); - standardCostService.iAppSceneCostResultValueService.save(resultValue); - } - } + } catch (Exception e) { throw new RuntimeException(e); } @@ -260,42 +625,7 @@ public class StandardCostService { log.info("sql1:" + sql1); String sql = sql1.replaceAll("^\"|\"$", ""); // 去除首尾引号 log.info("sql:" + sql); - JSONObject jsonObject = standardCostService.costMaterialBomMapper.customSelectOne(sql); - BigDecimal hourRate = new BigDecimal("0"); - if (jsonObject != null) { - AppSceneCostHourRate rate = JSON.toJavaObject(jsonObject, AppSceneCostHourRate.class); - hourRate = rate.getLaborHourRate(); - } - //1.查询出物料编号对应的下所有的BOM信息 - List list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", flowInstanceId); - //2.计算出所有的单个物料的人工成本 - //2.1查询出物料的人员工时和人工小时费率(涉及:小时费率表和工序表) - List MarterialNoList = new ArrayList<>(); - if (list != null && list.size() > 0) { - MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList()); - } - //查询工序工时 - Map> processHoursMap = standardCostService.costMaterialProcessHoursService.getProcessHoursByMaterialNo(MarterialNoList); - for (int i = 0; i < list.size(); i++) { - AppSceneCostResultValue appSceneCostResultValue = list.get(i); - String marterialNo = appSceneCostResultValue.getMarterialNo(); - if (marterialNo != null) { - BigDecimal totalCost = new BigDecimal("0.0"); - BigDecimal laborHours = new BigDecimal("0.0"); - List costMaterialProcessHours = processHoursMap.get(marterialNo); - if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { - for (int j = 0; j < costMaterialProcessHours.size(); j++) { - AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j); - laborHours = laborHours.add(processHours.getLaborHours()); - //计算总人工成本 - totalCost = totalCost.add(processHours.getLaborHours().multiply(hourRate)); - } - } - //2.2计算出人工成本并存储到成本结果数据表中 - AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build(); - standardCostService.iAppSceneCostResultValueService.save(resultValue); - } - } + } catch (Exception e) { throw new RuntimeException(e); } @@ -328,132 +658,7 @@ public class StandardCostService { log.info("sql1:" + sql1); String sql = sql1.replaceAll("^\"|\"$", ""); // 去除首尾引号 log.info("sql:" + sql); - JSONObject jsonObject = standardCostService.costMaterialBomMapper.customSelectOne(sql); - BigDecimal hourRate = new BigDecimal("0"); - if (jsonObject != null) { - AppSceneCostHourRate rate = JSON.toJavaObject(jsonObject, AppSceneCostHourRate.class); - hourRate = rate.getLaborHourRate(); - } - //1.查询出物料编号对应的下所有的BOM信息 - List list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", flowInstanceId); - //2.根据费用类型进行不同的费用计算 - //查询工序工时 - List MarterialNoList = new ArrayList<>(); - if (list != null && list.size() > 0) { - MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList()); - } - Map> processHoursMap = standardCostService.costMaterialProcessHoursService.getProcessHoursByMaterialNo(MarterialNoList); - //2.1机器折旧费(机器工时*费率) - if (FeeTypeEnum.EquipmentFee.getCode().equals(feeType)) { - for (int i = 0; i < list.size(); i++) { - AppSceneCostResultValue appSceneCostResultValue = list.get(i); - String marterialNo = appSceneCostResultValue.getMarterialNo(); - if (marterialNo != null) { - BigDecimal totalCost = new BigDecimal("0.0"); - BigDecimal laborHours = new BigDecimal("0.0"); - List costMaterialProcessHours = processHoursMap.get(marterialNo); - if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { - for (int j = 0; j < costMaterialProcessHours.size(); j++) { - AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j); - laborHours = laborHours.add(processHours.getDeviceHours()); - //计算机器成本 - totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate)); - } - } - //2.2计算机器成本并存储到成本结果数据表中 - AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build(); - standardCostService.iAppSceneCostResultValueService.save(resultValue); - } - } - } else if (FeeTypeEnum.SupplyMaterialFee.getCode().equals(feeType)) { - //机物料消耗(辅料工时*费率) - for (int i = 0; i < list.size(); i++) { - AppSceneCostResultValue appSceneCostResultValue = list.get(i); - String marterialNo = appSceneCostResultValue.getMarterialNo(); - if (marterialNo != null) { - BigDecimal totalCost = new BigDecimal("0.0"); - BigDecimal laborHours = new BigDecimal("0.0"); - List costMaterialProcessHours = processHoursMap.get(marterialNo); - if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { - for (int j = 0; j < costMaterialProcessHours.size(); j++) { - AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j); - //TODO 辅料工时来源 - laborHours = laborHours.add(processHours.getDeviceHours()); - //机物料消耗 - totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate)); - } - } - //2.2计算机物料消耗存储到成本结果数据表中 - AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build(); - standardCostService.iAppSceneCostResultValueService.save(resultValue); - } - } - } else if (FeeTypeEnum.DriverFee.getCode().equals(feeType)) { - //2.3水电费(燃动力工时*费率) - for (int i = 0; i < list.size(); i++) { - AppSceneCostResultValue appSceneCostResultValue = list.get(i); - String marterialNo = appSceneCostResultValue.getMarterialNo(); - if (marterialNo != null) { - BigDecimal totalCost = new BigDecimal("0.0"); - BigDecimal laborHours = new BigDecimal("0.0"); - List costMaterialProcessHours = processHoursMap.get(marterialNo); - if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { - for (int j = 0; j < costMaterialProcessHours.size(); j++) { - AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j); - //TODO 燃动力工时来源 - laborHours = laborHours.add(processHours.getDeviceHours()); - //水电费(燃动力工时*费率)成本 - totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate)); - } - } - //2.2计算机物料消耗存储到成本结果数据表中 - AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build(); - standardCostService.iAppSceneCostResultValueService.save(resultValue); - } - } - } else if (FeeTypeEnum.OtherFee.getCode().equals(feeType)) { - //2.4其他制费(其他工时*费率) - for (int i = 0; i < list.size(); i++) { - AppSceneCostResultValue appSceneCostResultValue = list.get(i); - String marterialNo = appSceneCostResultValue.getMarterialNo(); - if (marterialNo != null) { - BigDecimal totalCost = new BigDecimal("0.0"); - BigDecimal laborHours = new BigDecimal("0.0"); - List costMaterialProcessHours = processHoursMap.get(marterialNo); - if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { - for (int j = 0; j < costMaterialProcessHours.size(); j++) { - AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j); - //TODO 其他工时来源 - laborHours = laborHours.add(processHours.getDeviceHours()); - //其他制费成本 - totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate)); - } - } - //2.2计算机物料消耗存储到成本结果数据表中 - AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build(); - standardCostService.iAppSceneCostResultValueService.save(resultValue); - } - } - } else if (FeeTypeEnum.LogisticsFee.getCode().equals(feeType)) { - //查出所有的机器折旧费、机物料消耗、水电费、其他制费 - list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "ManufacturingCost", flowInstanceId); - //2.5物流费((机器折旧+机物料消耗+水电费+其他制费)*10.16%) - //按照物料编号进行分组 - Map> materialNoMap = list.stream().collect(Collectors.groupingBy(AppSceneCostResultValue::getMarterialNo)); - for (String key : materialNoMap.keySet()) { - List appSceneCostResultValues = materialNoMap.get(key); - BigDecimal totalCost = new BigDecimal("0.0"); - for (int j = 0; j < appSceneCostResultValues.size(); j++) { - AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValues.get(j); - String countValue = appSceneCostResultValue.getCountValue(); - if (countValue != null) { - totalCost = totalCost.add(new BigDecimal(countValue)); - } - } - AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(key).parentMarterialNo(appSceneCostResultValues.get(0).getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost.multiply(new BigDecimal("0.1016")).toString()).costType(feeType).build(); - standardCostService.iAppSceneCostResultValueService.save(resultValue); - } - } + } catch (Exception e) { throw new RuntimeException(e); } @@ -476,134 +681,6 @@ public class StandardCostService { //获取流程id String flowInstanceId = flowTaskInfoVO.getFlowInstanceId(); String costType = FeeTypeEnum.StandardCost.getCode(); - //1.查询出根物料编号对应的下所有的BOM信息结果值 - List list = standardCostService.iAppSceneCostResultValueService.getAllResultValueByTopMaterialNo(topMaterialCode, flowInstanceId); - //2.计算出所有的单个物料的本阶的标准成本(标准成本=物料成本+人工成本+制造费用) - //按照物料编号进行分组 - Map> materialNoMap = list.stream().collect(Collectors.groupingBy(AppSceneCostResultValue::getMarterialNo)); - //遍历根物料下所有的物料进行该物料本阶成本和费用类别的统计 - for (String key : materialNoMap.keySet()) { - List appSceneCostResultValues = materialNoMap.get(key); - //按照费用类别进行分组 - Map> costTypeMap = appSceneCostResultValues.stream().filter(s -> s.getCostType() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getCostType)); - //【本阶标准成本】 - BigDecimal currentCost = new BigDecimal("0.0"); - //1.本阶物料成本 - BigDecimal materialCost = new BigDecimal("0.0"); - //2.本阶人工成本 - BigDecimal laborCost = new BigDecimal("0.0"); - //3.本阶制造费(设备费) - BigDecimal equipmentCost = new BigDecimal("0.0"); - //4.本阶制造费(辅料费用) - BigDecimal supplyMaterialCost = new BigDecimal("0.0"); - //5.本阶制造费(水电费、燃动费) - BigDecimal driveCost = new BigDecimal("0.0"); - //6.本阶制造费(其他制造费用) - BigDecimal otherCost = new BigDecimal("0.0"); - //7.本阶制造费(物流费) - BigDecimal logisticsCost = new BigDecimal("0.0"); - //物料单价 - BigDecimal materialUnitPrice = new BigDecimal("0.0"); - //人员工时、小时费率 - BigDecimal laborHour = new BigDecimal("0.0"); - BigDecimal laborHourRate = new BigDecimal("0.0"); - //设备工时、小时费率 - BigDecimal equipmentHour = new BigDecimal("0.0"); - BigDecimal equipmentHourRate = new BigDecimal("0.0"); - //辅料工时、小时费率 - BigDecimal supplyMaterialHour = new BigDecimal("0.0"); - BigDecimal supplyMaterialHourRate = new BigDecimal("0.0"); - //燃动工时、小时费率 - BigDecimal driveHour = new BigDecimal("0.0"); - BigDecimal driveHourRate = new BigDecimal("0.0"); - //其他工时、小时费率 - BigDecimal otherHour = new BigDecimal("0.0"); - BigDecimal otherHourRate = new BigDecimal("0.0"); - AppSceneCostResultValue currentMaterialCost = null; - //遍历所有费用类别计算本阶标准成本 - for (int j = 0; j < appSceneCostResultValues.size(); j++) { - if (j == 0) { - currentMaterialCost = appSceneCostResultValues.get(0); - } - AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValues.get(j); - String countValue = appSceneCostResultValue.getCountValue(); - if (countValue != null) { - currentCost = currentCost.add(new BigDecimal(countValue)); - } - } - //计算本阶各个费用类别费用以及记录本阶物料的工时和小时费率 - for (String feeType : costTypeMap.keySet()) { - List appSceneCostResultValues1 = costTypeMap.get(feeType); - for (int m = 0; m < appSceneCostResultValues1.size(); m++) { - if (FeeTypeEnum.MaterialCost.getCode().equals(feeType)) { - //物料成本 - materialCost = materialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); - //物料单价 - materialUnitPrice = appSceneCostResultValues1.get(m).getPriceOrRate(); - } else if (FeeTypeEnum.LaborCost.getCode().equals(feeType)) { - //人工成本 - laborCost = laborCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); - //人工工时、小时费率 - laborHour = laborHour.add(appSceneCostResultValues1.get(m).getHour()); - laborHourRate = laborHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); - } else if (FeeTypeEnum.EquipmentFee.getCode().equals(feeType)) { - //设备费用 - equipmentCost = equipmentCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); - //设备工时、小时费率 - equipmentHour = equipmentHour.add(appSceneCostResultValues1.get(m).getHour()); - equipmentHourRate = equipmentHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); - } else if (FeeTypeEnum.SupplyMaterialFee.getCode().equals(feeType)) { - //辅料费用 - supplyMaterialCost = supplyMaterialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); - //辅料工时、小时费率 - supplyMaterialHour = supplyMaterialHour.add(appSceneCostResultValues1.get(m).getHour()); - supplyMaterialHourRate = supplyMaterialHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); - } else if (FeeTypeEnum.DriverFee.getCode().equals(feeType)) { - //燃动费用 - driveCost = driveCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); - //燃动工时、小时费率 - driveHour = driveHour.add(appSceneCostResultValues1.get(m).getHour()); - driveHourRate = driveHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); - } else if (FeeTypeEnum.LogisticsFee.getCode().equals(feeType)) { - //物流费用 - logisticsCost = logisticsCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); - } else if (FeeTypeEnum.OtherFee.getCode().equals(feeType)) { - //其他费用 - otherCost = otherCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue())); - //其他工时、小时费率 - otherHour = otherHour.add(appSceneCostResultValues1.get(m).getHour()); - otherHourRate = otherHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate()); - } - } - } - //本阶不同费用类别成本统计 - JSONObject currentLevelCostTypeDetail = new JSONObject(); - currentLevelCostTypeDetail.put(FeeTypeEnum.MaterialCost.getCode(), materialCost); - currentLevelCostTypeDetail.put(FeeTypeEnum.LaborCost.getCode(), laborCost); - currentLevelCostTypeDetail.put(FeeTypeEnum.EquipmentFee.getCode(), equipmentCost); - currentLevelCostTypeDetail.put(FeeTypeEnum.SupplyMaterialFee.getCode(), supplyMaterialCost); - currentLevelCostTypeDetail.put(FeeTypeEnum.DriverFee.getCode(), driveCost); - currentLevelCostTypeDetail.put(FeeTypeEnum.LogisticsFee.getCode(), logisticsCost); - currentLevelCostTypeDetail.put(FeeTypeEnum.OtherFee.getCode(), otherCost); - //统计本阶不同费用类别工时、小时费率 - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.MaterialUnitPrice.getCode(), materialUnitPrice); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHour.getCode(), laborHour); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHourRate.getCode(), laborHourRate); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHour.getCode(), equipmentHour); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHourRate.getCode(), equipmentHourRate); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHour.getCode(), supplyMaterialHour); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHourRate.getCode(), supplyMaterialHourRate); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHour.getCode(), driveHour); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHourRate.getCode(), driveHourRate); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHour.getCode(), otherHour); - currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHourRate.getCode(), otherHourRate); - AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(key).parentMarterialNo(currentMaterialCost.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(currentCost.toString()).costDetail(JSON.toJSONString(currentLevelCostTypeDetail)).costType(costType).build(); - standardCostService.iAppSceneCostResultValueService.save(resultValue); - } - //3.计算出所有的单个物料的累计标准成本 - List standardCostList = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, taskType, flowInstanceId); - //【累计成本】的计算 - totalCountCost(standardCostList, topMaterialCode, taskType, taskCode, flowInstanceId); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException("计算成本失败"); @@ -619,9 +696,9 @@ public class StandardCostService { * @param taskCode * @param flowInstanceId */ - private static void totalCountCost(List standardCostList, String topMaterialCode, String taskType, String taskCode, String flowInstanceId) { + private static void totalCountCost(List standardCostList, String topMaterialCode, String taskType, String taskCode, String flowInstanceId, String versionNumber) { try { - List costStandardDetails = new ArrayList<>(); + List costStandardResults = new ArrayList<>(); //父类对应的子节点(除了最上层节点) Map> parentMaterialNoMap = standardCostList.stream().filter(appSceneCostResultValue -> appSceneCostResultValue.getParentMarterialNo() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getParentMarterialNo)); for (int i = 0; i < standardCostList.size(); i++) { @@ -652,16 +729,16 @@ public class StandardCostService { oldAppSceneCostResultValue.setTotalValue(hourOrRateResultValue.getTotalCost().toString()); standardCostService.iAppSceneCostResultValueService.updateById(oldAppSceneCostResultValue); //构造单行成本查询记录 - AppSceneCostStandardDetail costStandardDetail = AppSceneCostStandardDetail.builder().materialNumber(oldAppSceneCostResultValue.getMarterialNo()).materialName(oldAppSceneCostResultValue.getMarterialNo()).parentMaterialNumber(oldAppSceneCostResultValue.getParentMarterialNo()) -// .versionNumber() + AppSceneCostStandardResult costStandardResultValue = AppSceneCostStandardResult.builder().materialNumber(oldAppSceneCostResultValue.getMarterialNo()).parentMatnr(oldAppSceneCostResultValue.getParentMarterialNo()).versionNumber(versionNumber) // .level() // .sort() // .figureNumber() - .dosage(oldAppSceneCostResultValue.getNum() != null ? new Double(oldAppSceneCostResultValue.getNum()) : 0).unit(oldAppSceneCostResultValue.getUnit()).materialCost(costDetailJson.getBigDecimal(FeeTypeEnum.MaterialCost.getCode())).laborCost(costDetailJson.getBigDecimal(FeeTypeEnum.LaborCost.getCode())).equipmentCost(costDetailJson.getBigDecimal(FeeTypeEnum.EquipmentFee.getCode())).supplyMaterialCost(costDetailJson.getBigDecimal(FeeTypeEnum.SupplyMaterialFee.getCode())).driveCost(costDetailJson.getBigDecimal(FeeTypeEnum.DriverFee.getCode())).logisticsCost(costDetailJson.getBigDecimal(FeeTypeEnum.LogisticsFee.getCode())).otherCost(costDetailJson.getBigDecimal(FeeTypeEnum.OtherFee.getCode())).currentStandardCost(new BigDecimal(oldAppSceneCostResultValue.getCountValue())).totalMaterialCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalMaterialCost.getCode())).totalLaborCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalLaborCost.getCode())).totalEquipmentCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalEquipmentFee.getCode())).totalSupplyMaterialCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalSupplyMaterialFee.getCode())).totalDriveCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalDriverFee.getCode())).totalLogisticsCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalLogisticsFee.getCode())).totalOtherCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalOtherFee.getCode())).totalStandardCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalStandardCost.getCode())).createTime(new Date()).build(); - costStandardDetails.add(costStandardDetail); +// .dosage(oldAppSceneCostResultValue.getNum() != null ? oldAppSceneCostResultValue.getNum().doubleValue() : 0).unit(oldAppSceneCostResultValue.getUnit()) + .materialCostStageInter(costDetailJson.getBigDecimal(FeeTypeEnum.MaterialCost.getCode())).laborCostStage(costDetailJson.getBigDecimal(FeeTypeEnum.LaborCost.getCode())).equipCostStage(costDetailJson.getBigDecimal(FeeTypeEnum.EquipmentFee.getCode())).auxiliaryCostStage(costDetailJson.getBigDecimal(FeeTypeEnum.SupplyMaterialFee.getCode())).burningCostStage(costDetailJson.getBigDecimal(FeeTypeEnum.DriverFee.getCode())).stageLogisticsCost(costDetailJson.getBigDecimal(FeeTypeEnum.LogisticsFee.getCode())).otherCostStage(costDetailJson.getBigDecimal(FeeTypeEnum.OtherFee.getCode())).totalStandardCostInter(new BigDecimal(oldAppSceneCostResultValue.getCountValue())).materialCostAccumulated(costDetailJson.getBigDecimal(TotalCostEnum.TotalMaterialCost.getCode())).laborCostAccumulated(costDetailJson.getBigDecimal(TotalCostEnum.TotalLaborCost.getCode())).equipCostAccumulated(costDetailJson.getBigDecimal(TotalCostEnum.TotalEquipmentFee.getCode())).auxiliaryCostAccumulated(costDetailJson.getBigDecimal(TotalCostEnum.TotalSupplyMaterialFee.getCode())).burningCostAccumulated(costDetailJson.getBigDecimal(TotalCostEnum.TotalDriverFee.getCode())).totalLogisticsCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalLogisticsFee.getCode())).otherCostAccumulated(costDetailJson.getBigDecimal(TotalCostEnum.TotalOtherFee.getCode())).totalStandardCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalStandardCost.getCode())).createdTime(new Date()).build(); + costStandardResults.add(costStandardResultValue); } //更新结果集到标准成本单行查询中去 - standardCostService.iAppSceneCostStandardDetailService.saveBatch(costStandardDetails); + standardCostService.iAppSceneCostStandardResultService.saveBatch(costStandardResults); } catch (Exception e) { e.printStackTrace(); } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostBomRelevancyService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostBomRelevancyService.java index bad9322..dc95f4b 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostBomRelevancyService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostBomRelevancyService.java @@ -3,6 +3,8 @@ package com.zzsmart.qomo.kn.cost.manage.service; import com.baomidou.mybatisplus.extension.service.IService; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy; +import java.util.List; + /** * @Description: app_scene_cost_bom_relevancy * @Author: jeecg-boot @@ -10,5 +12,18 @@ import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy; * @Version: V1.0 */ public interface IAppSceneCostBomRelevancyService extends IService { + /** + * 分页查询 + * @param + * @return + */ + List queryListResult(String materialNumber); + + /** + * 查询最顶层物料编号下所有的物料 + * @param topMaterialCode + * @return + */ + List queryAllBomInfoByTopMaterialCode(String topMaterialCode); } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostCountService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostCountService.java index c986fef..3796688 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostCountService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostCountService.java @@ -2,6 +2,7 @@ package com.zzsmart.qomo.kn.cost.manage.service; import com.baomidou.mybatisplus.extension.service.IService; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; +import com.zzsmart.qomo.kn.cost.manage.vo.AppSceneCostCountVO; import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO; import java.util.List; @@ -31,5 +32,5 @@ public interface IAppSceneCostCountService extends IService { * 添加标准成本计算任务 * @param appSceneCostCount */ - void addCostCountTask(AppSceneCostCount appSceneCostCount); + void addCostCountTask(AppSceneCostCountVO appSceneCostCount); } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostHourRateService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostHourRateService.java index 830ba71..8525fb7 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostHourRateService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostHourRateService.java @@ -10,5 +10,10 @@ import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostHourRate; * @Version: V1.0 */ public interface IAppSceneCostHourRateService extends IService { - + /** + * 查询满足条件的一条小时费率信息 + * @param appSceneCostHourRate + * @return + */ + AppSceneCostHourRate getOneHourRateInfo(AppSceneCostHourRate appSceneCostHourRate); } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialBomService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialBomService.java deleted file mode 100644 index 9036f61..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialBomService.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialBom; - -import java.util.List; - -/** - * @Description: app_scene_cost_material_bom - * @Author: jeecg-boot - * @Date: 2024-08-02 - * @Version: V1.0 - */ -public interface IAppSceneCostMaterialBomService extends IService { - /** - * 分页查询 - * @param - * @return - */ - List queryListResult(String materialNumber); - - /** - * 查询最顶层物料编号下所有的物料 - * @param topMaterialCode - * @return - */ - List queryAllBomInfoBytopMaterialCode(String topMaterialCode); -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialProcessHoursService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialProcessHoursService.java deleted file mode 100644 index 5487ab5..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostMaterialProcessHoursService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialProcessHours; -import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostMaterialProcessHoursMapper; - -import java.util.List; -import java.util.Map; - -/** - * @Description: app_scene_cost_material_process_hours - * @Author: jeecg-boot - * @Date: 2024-08-02 - * @Version: V1.0 - */ -public interface IAppSceneCostMaterialProcessHoursService extends IService { - /** - * 查询满足物料编号的工时工序 - */ - Map> getProcessHoursByMaterialNo(List materialNos); - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostProductProcessMaintenanceService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostProductProcessMaintenanceService.java index 76ce058..0a1b04f 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostProductProcessMaintenanceService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostProductProcessMaintenanceService.java @@ -3,12 +3,19 @@ package com.zzsmart.qomo.kn.cost.manage.service; import com.baomidou.mybatisplus.extension.service.IService; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostProductProcessMaintenance; +import java.util.List; +import java.util.Map; + /** * @Description: app_scene_cost_product_process_maintenance * @Author: jeecg-boot - * @Date: 2024-09-08 + * @Date: 2024-09-08 * @Version: V1.0 */ public interface IAppSceneCostProductProcessMaintenanceService extends IService { + /** + * 查询满足物料编号的工时工序 + */ + Map> getProcessHoursByMaterialNo(List materialNos); } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchasePriceService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchasePriceService.java deleted file mode 100644 index ee33790..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchasePriceService.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service; - -import com.baomidou.mybatisplus.extension.service.IService; -import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchasePrice; - -import java.math.BigDecimal; -import java.util.List; -import java.util.Map; - -/** - * @Description: app_scene_cost_purchase_price - * @Author: jeecg-boot - * @Date: 2024-08-02 - * @Version: V1.0 - */ -public interface IAppSceneCostPurchasePriceService extends IService { - /** - * 查询满足物料编号的最低采购价 - */ - Map getMinCostPurchasePriceByMaterialNo(List materialNos); - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseRecordService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseRecordService.java index ce23c84..f0bd662 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseRecordService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostPurchaseRecordService.java @@ -3,6 +3,10 @@ package com.zzsmart.qomo.kn.cost.manage.service; import com.baomidou.mybatisplus.extension.service.IService; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseRecord; +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + /** * @Description: app_scene_cost_purchase_record * @Author: jeecg-boot @@ -10,5 +14,9 @@ import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseRecord; * @Version: V1.0 */ public interface IAppSceneCostPurchaseRecordService extends IService { + /** + * 查询满足物料编号的最低采购价 + */ + Map getMinCostPurchasePriceByMaterialNo(List materialNos); } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostStandardResultService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostStandardResultService.java new file mode 100644 index 0000000..9f143cd --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostStandardResultService.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardResult; + +/** + * @Description: app_scene_cost_standard_detail + * @Author: jeecg-boot + * @Date: 2024-07-31 + * @Version: V1.0 + */ +public interface IAppSceneCostStandardResultService extends IService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostBomRelevancyServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostBomRelevancyServiceImpl.java index a9b0247..2c9f11d 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostBomRelevancyServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostBomRelevancyServiceImpl.java @@ -1,19 +1,60 @@ package com.zzsmart.qomo.kn.cost.manage.service.impl; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostBomRelevancy; import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostBomRelevancyMapper; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostBomRelevancyService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.List; + /** * @Description: app_scene_cost_bom_relevancy * @Author: jeecg-boot - * @Date: 2024-09-08 + * @Date: 2024-09-08 * @Version: V1.0 */ @Service public class AppSceneCostBomRelevancyServiceImpl extends ServiceImpl implements IAppSceneCostBomRelevancyService { + /** + * 物料BOM信息 + */ + @Autowired + AppSceneCostBomRelevancyMapper costMaterialBomMapper; + + /** + * 分页查询 + * + * @param materialNumber + * @return + */ + @Override + public List queryListResult(String materialNumber) { + QueryWrapper queryWrapper = new QueryWrapper(); + if (StrUtil.isNotEmpty(materialNumber)) { + // 物料号 + queryWrapper.like("material_code", materialNumber); + } + List list = costMaterialBomMapper.selectList(queryWrapper); + return list; + } + + /** + * 查询最顶层物料编号下所有的物料 + * + * @param topMaterialCode + * @return + */ + @Override + public List queryAllBomInfoByTopMaterialCode(String topMaterialCode) { + List childrens = costMaterialBomMapper.findChildrenByParentId(topMaterialCode); + //TODO 循环遍历查出所有的物料下的物料(包含最上层的物料) + //TODO 所有的物料并进行层级排序 + return childrens; + } } 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 b90efaf..2707195 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 @@ -7,14 +7,17 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.zzsmart.qomo.dao.entity.FlowInstance; import com.zzsmart.qomo.dao.entity.FlowInstanceParameter; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostHourRate; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPartMissingInfo; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion; import com.zzsmart.qomo.kn.cost.manage.enums.CostCountStatusEnum; +import com.zzsmart.qomo.kn.cost.manage.enums.FeeTypeEnum; import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostCountMapper; import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPartMissingInfoMapper; import com.zzsmart.qomo.kn.cost.manage.plugin.StandardCostService; 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.AppSceneCostCountVO; import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO; import com.zzsmart.qomo.service.IDataFlowInstanceService; import com.zzsmart.qomo.service.IFlowInstanceParameterService; @@ -24,6 +27,7 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Random; /** * @Description: app_scene_cost_count @@ -41,8 +45,7 @@ public class AppSceneCostCountServiceImpl extends ServiceImpl implements IAppSceneCostHourRateService { + /** + * 查询满足条件的一条小时费率信息 + * + * @param appSceneCostHourRate + * @return + */ + @Override + public AppSceneCostHourRate getOneHourRateInfo(AppSceneCostHourRate appSceneCostHourRate) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + if(appSceneCostHourRate!=null){ + if(appSceneCostHourRate.getYear()!=null){ + queryWrapper.eq("year",appSceneCostHourRate.getYear()); + } + if(appSceneCostHourRate.getCostCenterCode()!=null){ + queryWrapper.eq("cost_center_code",appSceneCostHourRate.getCostCenterCode()); + } + if(appSceneCostHourRate.getFactory()!=null){ + queryWrapper.eq("factory",appSceneCostHourRate.getFactory()); + } + queryWrapper.last("limit 1"); + return this.getOne(queryWrapper); + } + return null; + } } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialBomServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialBomServiceImpl.java deleted file mode 100644 index cbd4bef..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialBomServiceImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service.impl; - -import cn.hutool.core.util.StrUtil; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialBom; -import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostMaterialBomMapper; -import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostMaterialBomService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; - -import java.util.List; - -/** - * @Description: app_scene_cost_material_bom - * @Author: jeecg-boot - * @Date: 2024-08-02 - * @Version: V1.0 - */ -@Service -public class AppSceneCostMaterialBomServiceImpl extends ServiceImpl implements IAppSceneCostMaterialBomService { - @Autowired - AppSceneCostMaterialBomMapper costMaterialBomMapper; - - /** - * 分页查询 - * - * @param materialNumber - * @return - */ - @Override - public List queryListResult(String materialNumber) { - QueryWrapper queryWrapper = new QueryWrapper(); - if (StrUtil.isNotEmpty(materialNumber)) { - // 物料号 - queryWrapper.like("material_code", materialNumber); - } - List list = costMaterialBomMapper.selectList(queryWrapper); - return list; - } - - /** - * 查询最顶层物料编号下所有的物料 - * - * @param topMaterialCode - * @return - */ - @Override - public List queryAllBomInfoBytopMaterialCode(String topMaterialCode) { - QueryWrapper queryWrapper = new QueryWrapper(); - //TODO 循环遍历查出所有的物料下的物料(包含最上层的物料) -// if (StrUtil.isNotEmpty(topMaterialCode)) { -// // 物料号 -// queryWrapper.like("material_code", topMaterialCode); -// } - List list = costMaterialBomMapper.selectList(queryWrapper); - return list; - } -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialProcessHoursServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialProcessHoursServiceImpl.java deleted file mode 100644 index b2ff71b..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostMaterialProcessHoursServiceImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -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.kn.cost.manage.entity.AppSceneCostMaterialProcessHours; -import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostMaterialProcessHoursMapper; -import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostMaterialProcessHoursService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @Description: app_scene_cost_material_process_hours - * @Author: jeecg-boot - * @Date: 2024-08-02 - * @Version: V1.0 - */ -@Service -public class AppSceneCostMaterialProcessHoursServiceImpl extends ServiceImpl implements IAppSceneCostMaterialProcessHoursService { - @Autowired - AppSceneCostMaterialProcessHoursMapper costMaterialProcessHoursMapper; - - /** - * 查询满足物料编号的工时工序 - * - * @param materialNos - */ - @Override - public Map> getProcessHoursByMaterialNo(List materialNos) { - Map> map = new HashMap<>(); - QueryWrapper queryWrapper = new QueryWrapper(); - if (materialNos != null && materialNos.size() > 0) { - queryWrapper.in("material_code", materialNos); - List costMaterialProcessHours = costMaterialProcessHoursMapper.selectList(queryWrapper); - for (int i = 0; i < costMaterialProcessHours.size(); i++) { - AppSceneCostMaterialProcessHours costMaterialProcessHours1 = costMaterialProcessHours.get(i); - String materialCode = costMaterialProcessHours1.getMaterialCode(); - if (map.containsKey(materialCode)) { - List list = map.get(materialCode); - list.add(costMaterialProcessHours1); - map.put(materialCode, list); - } else { - List list = new ArrayList<>(); - list.add(costMaterialProcessHours1); - map.put(materialCode, list); - } - } - } - return map; - } -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostProductProcessMaintenanceServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostProductProcessMaintenanceServiceImpl.java index 5ecdd44..a6f42ac 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostProductProcessMaintenanceServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostProductProcessMaintenanceServiceImpl.java @@ -1,19 +1,57 @@ 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.kn.cost.manage.entity.AppSceneCostProductProcessMaintenance; import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostProductProcessMaintenanceMapper; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostProductProcessMaintenanceService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; /** * @Description: app_scene_cost_product_process_maintenance * @Author: jeecg-boot - * @Date: 2024-09-08 + * @Date: 2024-09-08 * @Version: V1.0 */ @Service public class AppSceneCostProductProcessMaintenanceServiceImpl extends ServiceImpl implements IAppSceneCostProductProcessMaintenanceService { + @Autowired + AppSceneCostProductProcessMaintenanceMapper costMaterialProcessHoursMapper; + + /** + * 查询满足物料编号的工时工序 + * + * @param materialNos + */ + @Override + public Map> getProcessHoursByMaterialNo(List materialNos) { + Map> map = new HashMap<>(); + QueryWrapper queryWrapper = new QueryWrapper(); + if (materialNos != null && materialNos.size() > 0) { + queryWrapper.in("main_part_number", materialNos); + queryWrapper.orderByAsc("serial_number"); + List costMaterialProcessHours = costMaterialProcessHoursMapper.selectList(queryWrapper); + for (int i = 0; i < costMaterialProcessHours.size(); i++) { + AppSceneCostProductProcessMaintenance costMaterialProcessHours1 = costMaterialProcessHours.get(i); + String materialCode = costMaterialProcessHours1.getMainPartNumber(); + if (map.containsKey(materialCode)) { + List list = map.get(materialCode); + list.add(costMaterialProcessHours1); + map.put(materialCode, list); + } else { + List list = new ArrayList<>(); + list.add(costMaterialProcessHours1); + map.put(materialCode, list); + } + } + } + return map; + } } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchasePriceServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchasePriceServiceImpl.java deleted file mode 100644 index 230f850..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchasePriceServiceImpl.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchasePrice; -import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPurchasePriceMapper; -import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchasePriceService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; - -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * @Description: app_scene_cost_purchase_price - * @Author: jeecg-boot - * @Date: 2024-08-02 - * @Version: V1.0 - */ -@Service -public class AppSceneCostPurchasePriceServiceImpl extends ServiceImpl implements IAppSceneCostPurchasePriceService { - @Autowired - AppSceneCostPurchasePriceMapper costPurchasePriceMapper; - - /** - * 查询满足物料编号的最低采购价 - * - * @param materialNos - */ - @Override - public Map getMinCostPurchasePriceByMaterialNo(List materialNos) { - Map map = new HashMap<>(); - QueryWrapper queryWrapper = new QueryWrapper(); - if (materialNos != null && materialNos.size() > 0) { - queryWrapper.in("material_code", materialNos); - List costPurchasePrices = costPurchasePriceMapper.selectList(queryWrapper); - for (int i = 0; i < costPurchasePrices.size(); i++) { - AppSceneCostPurchasePrice costPurchasePrice = costPurchasePrices.get(i); - map.put(costPurchasePrice.getMaterialCode(), costPurchasePrice.getMinPurchasePrice()); - } - } - return map; - } -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseRecordServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseRecordServiceImpl.java index 1a4d138..102bf5d 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseRecordServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostPurchaseRecordServiceImpl.java @@ -1,11 +1,18 @@ 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.kn.cost.manage.entity.AppSceneCostPurchaseRecord; import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPurchaseRecordMapper; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchaseRecordService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * @Description: app_scene_cost_purchase_record * @Author: jeecg-boot @@ -14,5 +21,26 @@ import org.springframework.stereotype.Service; */ @Service public class AppSceneCostPurchaseRecordServiceImpl extends ServiceImpl implements IAppSceneCostPurchaseRecordService { + @Autowired + AppSceneCostPurchaseRecordMapper appSceneCostPurchaseRecordMapper; + /** + * 查询满足物料编号的最低采购价 + * + * @param materialNos + */ + @Override + public Map getMinCostPurchasePriceByMaterialNo(List materialNos) { + Map map = new HashMap<>(); + QueryWrapper queryWrapper = new QueryWrapper(); + if (materialNos != null && materialNos.size() > 0) { + queryWrapper.in("INFNR", materialNos); + List costPurchasePrices = appSceneCostPurchaseRecordMapper.selectList(queryWrapper); + for (int i = 0; i < costPurchasePrices.size(); i++) { + AppSceneCostPurchaseRecord costPurchasePrice = costPurchasePrices.get(i); + map.put(costPurchasePrice.getInfnr(), costPurchasePrice.getNetpr()); + } + } + return map; + } } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostResultValueServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostResultValueServiceImpl.java index 8fa6839..ed9693f 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostResultValueServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostResultValueServiceImpl.java @@ -28,19 +28,19 @@ public class AppSceneCostResultValueServiceImpl extends ServiceImpl getResultValueByTopMaterialNo(String topMaterialCode, String lastTaskType, String flowInstanceId) { + public List getResultValueByTopMaterialNo(String topMaterialCode, String taskType, String flowInstanceId) { List result = new ArrayList<>(); QueryWrapper queryWrapper = new QueryWrapper<>(); - if (topMaterialCode != null && !topMaterialCode.equals("") && lastTaskType != null && !lastTaskType.equals("") && flowInstanceId != null && !flowInstanceId.equals("")) { + if (topMaterialCode != null && !topMaterialCode.equals("") && taskType != null && !taskType.equals("") && flowInstanceId != null && !flowInstanceId.equals("")) { //查询某个流程节点(即执行任务)的结果值 - queryWrapper.eq("belong_top_material_no", topMaterialCode).eq("task_type", lastTaskType).eq("flow_instance_id", flowInstanceId); + queryWrapper.eq("belong_top_material_no", topMaterialCode).eq("task_type", taskType).eq("flow_instance_id", flowInstanceId); result = appSceneCostResultValueMapper.selectList(queryWrapper); - } else if (topMaterialCode != null && !topMaterialCode.equals("") && flowInstanceId != null && !flowInstanceId.equals("") && lastTaskType == null) { + } else if (topMaterialCode != null && !topMaterialCode.equals("") && flowInstanceId != null && !flowInstanceId.equals("") && taskType == null) { //查询BOM物料所有的树节点信息 queryWrapper.eq("belong_top_material_no", topMaterialCode).eq("flow_instance_id", flowInstanceId).isNull("task_type"); result = appSceneCostResultValueMapper.selectList(queryWrapper); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostStandardResultServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostStandardResultServiceImpl.java new file mode 100644 index 0000000..7f27916 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostStandardResultServiceImpl.java @@ -0,0 +1,21 @@ +package com.zzsmart.qomo.kn.cost.manage.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardDetail; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardResult; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostStandardDetailMapper; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostStandardResultMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardDetailService; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardResultService; +import org.springframework.stereotype.Service; + +/** + * @Description: app_scene_cost_standard_detail + * @Author: jeecg-boot + * @Date: 2024-07-31 + * @Version: V1.0 + */ +@Service +public class AppSceneCostStandardResultServiceImpl extends ServiceImpl implements IAppSceneCostStandardResultService { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostCountVO.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostCountVO.java index c9fc892..6546b30 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostCountVO.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostCountVO.java @@ -1,12 +1,66 @@ package com.zzsmart.qomo.kn.cost.manage.vo; -import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; @Data -public class AppSceneCostCountVO extends AppSceneCostCount { +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class AppSceneCostCountVO { + /** + * 主键 + */ + @ApiModelProperty(value = "主键") + private Integer id; + /** + * 物料编号 + */ + @ApiModelProperty(value = "物料编号") + private String materialNo; + /** + * 图号 + */ + @ApiModelProperty(value = "图号") + private String drawingNo; + /** + * stage + */ + @ApiModelProperty(value = "stage") + private String stage; + /** + * 标准成本计算流程id + */ + @ApiModelProperty(value = "标准成本计算流程id") + private Integer flowDefinitionId; + /** + * year + */ + @ApiModelProperty(value = "year") + private String year; + /** + * 状态 + */ + @ApiModelProperty(value = "状态") + private Integer status; + /** + * 模型版本 + */ + @ApiModelProperty(value = "标准成本版本") + private String costVersion; /** * 状态名称 */ public String statusName; + /** + * 成本中心 + */ + public String costCenter; + /** + * 工厂 + */ + public String factory; } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostModelDefinitionVO.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostModelDefinitionVO.java index 35bf7b9..2ed62fc 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostModelDefinitionVO.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostModelDefinitionVO.java @@ -12,7 +12,6 @@ import lombok.NoArgsConstructor; * 模型信息封装 */ @Data -@Builder @AllArgsConstructor @NoArgsConstructor public class CostModelDefinitionVO extends AppSceneCostModel { -- 2.54.0 From fe4b315987d75ad956f52eb517ba62b2d541220b Mon Sep 17 00:00:00 2001 From: bgy <1322446236@qq.com> Date: Tue, 17 Sep 2024 00:35:22 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8D=95=E8=A1=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=EF=BC=88=E7=BB=93=E6=9E=9C=E9=9B=86=E6=98=A0?= =?UTF-8?q?=E5=B0=84=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yml | 4 +- .../AppSceneCostStandardResultController.java | 46 +++- .../entity/AppSceneCostStandardDetail.java | 132 ++++++++--- .../vo/AppSceneCostStandardResultVO.java | 209 ++++++++++++++++++ 4 files changed, 351 insertions(+), 40 deletions(-) create mode 100644 qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/AppSceneCostStandardResultVO.java 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 d5f57ae..26d00f7 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 @@ -296,8 +296,8 @@ jeecg: #webapp文件路径 webapp: /opt/webapp shiro: -# excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/** - excludeUrls: /**/**,/**/**/** + excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/** +# excludeUrls: /**/**,/**/**/** #阿里云oss存储和大鱼短信秘钥配置 oss: diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardResultController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardResultController.java index 4cb2fa3..f8b5a2c 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardResultController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostStandardResultController.java @@ -6,12 +6,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardDetail; import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardResult; import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardResultService; +import com.zzsmart.qomo.kn.cost.manage.vo.AppSceneCostStandardResultVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -20,6 +22,8 @@ import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.List; /** * @Description: app_scene_cost_standard_detail @@ -47,11 +51,47 @@ public class AppSceneCostStandardResultController extends JeecgController> queryPageList(AppSceneCostStandardResult appSceneCostStandardResult, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + public Result> queryPageList(AppSceneCostStandardResult appSceneCostStandardResult, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostStandardResult, req.getParameterMap()); Page page = new Page(pageNo, pageSize); IPage pageList = appSceneCostStandardResultService.page(page, queryWrapper); - return Result.OK(pageList); + IPage newpageList = new Page<>(); + BeanUtils.copyProperties(pageList, newpageList); + List list = pageList.getRecords(); + List newList = new ArrayList<>(); + for (int i = 0; i < list.size(); i++) { + AppSceneCostStandardResult result = list.get(i); + AppSceneCostStandardResultVO costStandardDetail = AppSceneCostStandardResultVO.builder() + .materialNumber(result.getMaterialNumber()) +// .materialName(oldAppSceneCostResultValue.getMarterialNo()) + .parentMaterialNumber(result.getParentMatnr()) + .versionNumber(result.getVersionNumber()) +// .level() +// .sort() +// .figureNumber() +// .dosage(oldAppSceneCostResultValue.getNum() != null ? new Double(oldAppSceneCostResultValue.getNum()) : 0) +// .unit(oldAppSceneCostResultValue.getUnit()) + .materialCost(result.getMaterialCostStage()) + .laborCost(result.getLaborCostStage()) + .equipmentCost(result.getEquipCostStage()) + .supplyMaterialCost(result.getAuxiliaryCostStage()) + .driveCost(result.getBurningCostStage()) + .logisticsCost(result.getStageLogisticsCost()) + .otherCost(result.getOtherCostStage()) + .currentStandardCost(result.getTotalStandardCostInter()) + .totalMaterialCost(result.getMaterialCostAccumulated()) + .totalLaborCost(result.getLaborCostAccumulated()) + .totalEquipmentCost(result.getEquipCostAccumulated()) + .totalSupplyMaterialCost(result.getAuxiliaryCostAccumulated()) + .totalDriveCost(result.getBurningCostAccumulated()) + .totalLogisticsCost(result.getTotalLogisticsCost()) + .totalOtherCost(result.getOtherCostAccumulated()) + .totalStandardCost(result.getTotalStandardCost()) + .createTime(result.getCreatedTime()).build(); + newList.add(costStandardDetail); + } + newpageList.setRecords(newList); + return Result.OK(newpageList); } // // /** @@ -138,7 +178,7 @@ public class AppSceneCostStandardResultController extends JeecgController