diff --git a/pom.xml b/pom.xml index 7de4a6d..7f9a66e 100644 --- a/pom.xml +++ b/pom.xml @@ -1,12 +1,17 @@ - + + 4.0.0 com.zzsmart.qomo qomo-kn-forecast ${revision} pom - QOMO FORECAST - + QOMO Cost Manage + + qomo-kn-cost-manage-start + qomo-kn-cost-manage + 武汉中制智造 @@ -24,13 +29,8 @@ 2.0.0-SNAPSHOT 2.0.0-SNAPSHOT + 2.0.0-SNAPSHOT - - - qomo-kn-cost-manage-start - qomo-kn-cost-manage - - zzzz @@ -98,9 +98,53 @@ qomo-kn-cost-manage ${revision} + + com.zzsmart.qomo + qomo-data-model + ${dmp.version} + + + + com.zzsmart.qomo + qomo-assets-management + ${dmp.version} + + + + com.zzsmart.qomo + qomo-data-integration + ${dmp.version} + + + + com.zzsmart.qomo + qomo-data-metadata + ${dmp.version} + + + + com.zzsmart.qomo + qomo-work-flow + ${dmp.version} + + + + com.zzsmart.qomo + qomo-data-warehouse + ${dmp.version} + + + com.zzsmart.qomo + qomo-data-selfReport + ${dmp.version} + + + + + + - @@ -175,4 +219,4 @@ - + \ No newline at end of file diff --git a/qomo-kn-cost-manage-start/pom.xml b/qomo-kn-cost-manage-start/pom.xml index 6818928..ccb8b34 100644 --- a/qomo-kn-cost-manage-start/pom.xml +++ b/qomo-kn-cost-manage-start/pom.xml @@ -2,13 +2,12 @@ + 4.0.0 com.zzsmart.qomo qomo-kn-forecast ${revision} - 4.0.0 - qomo-kn-cost-manage-start @@ -52,4 +51,52 @@ + + + dmp + + + true + + + dmp + + + + com.zzsmart.qomo + qomo-data-model + + + + com.zzsmart.qomo + qomo-assets-management + + + + com.zzsmart.qomo + qomo-data-integration + + + + com.zzsmart.qomo + qomo-data-metadata + + + + com.zzsmart.qomo + qomo-work-flow + + + + com.zzsmart.qomo + qomo-data-warehouse + + + com.zzsmart.qomo + qomo-data-selfReport + + + + + \ No newline at end of file diff --git a/qomo-kn-cost-manage-start/src/main/java/com/zzsmart/qomo/kn/cost/manage/QomoCostManageApplication.java b/qomo-kn-cost-manage-start/src/main/java/com/zzsmart/qomo/kn/cost/manage/QomoCostManageApplication.java index c20c2fb..d68a8dc 100644 --- a/qomo-kn-cost-manage-start/src/main/java/com/zzsmart/qomo/kn/cost/manage/QomoCostManageApplication.java +++ b/qomo-kn-cost-manage-start/src/main/java/com/zzsmart/qomo/kn/cost/manage/QomoCostManageApplication.java @@ -2,6 +2,7 @@ package com.zzsmart.qomo.kn.cost.manage; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.util.oConvertUtils; +import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; @@ -14,11 +15,12 @@ import java.net.InetAddress; import java.net.UnknownHostException; /** -* 单体启动类 -* 报错提醒: 未集成mongo报错,可以打开启动类上面的注释 exclude={MongoAutoConfiguration.class} -*/ + * 单体启动类 + * 报错提醒: 未集成mongo报错,可以打开启动类上面的注释 exclude={MongoAutoConfiguration.class} + */ @Slf4j -@SpringBootApplication (scanBasePackages ={"org.jeecg", "com.zzsmart.qomo"}) +@SpringBootApplication(scanBasePackages = {"org.jeecg", "com.zzsmart.qomo"}) +//@MapperScan({"com.zzsmart.qomo.kn.cost.manage.mapper"}) //@EnableAutoConfiguration(exclude={MongoAutoConfiguration.class}) @EnableAsync public class QomoCostManageApplication extends SpringBootServletInitializer { 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 474381d..ffffd3c 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 @@ -3,19 +3,19 @@ v2: xnljmap: #win服务器 本地 注意!! 记住这个结尾有一个/ oss: file:/data/qomo-boot/oss/ -# oss: file:D:/upload/ + # oss: file:D:/upload/ #linux服务器 #oss: file:/home/webapps/oss/ #虚拟路径映射路径 end #本地存放地址 注意!! 记住这个结尾没有/ fileurl: /data/qomo-boot/oss -# fileurl: D:/upload + # fileurl: D:/upload #http://127.0.0.1:8080/oss/{yy}/2022-12-22/c83a77ae134a540c30daa6a0666fa945.md httpurl: /qomo/ defaultFormat: .png server: - port: 8095 + port: 8082 tomcat: max-swallow-size: -1 error: @@ -154,8 +154,7 @@ spring: prefer-file-system-access: false # 设置ftl文件路径 template-loader-path: - - classpath:/template -# - d:/data + - classpath:/templates template_update_delay: 0 # 设置静态文件路径,js,css等 mvc: @@ -207,13 +206,10 @@ spring: connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 datasource: master: - url: jdbc:mysql://121.40.189.20:3306/knne?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=true&serverTimezone=Asia/Shanghai - username: root - password: YMzc157# + url: jdbc:mysql://192.168.50.9:2212/selef_report?useUnicode=true&allowMultiQueries=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useSSL=false + username: zzzz + password: knphm2021 driver-class-name: com.mysql.cj.jdbc.Driver -# url: jdbc:mysql://192.168.50.9:2212/selef_report?useUnicode=true&allowMultiQueries=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useSSL=false -# username: root -# password: root # 多数据源配置 #multi-datasource1: #url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai @@ -222,12 +218,13 @@ spring: #driver-class-name: com.mysql.cj.jdbc.Driver #redis 配置 redis: - database: 5 -# host: 192.168.50.9 -# port: 7379 -# password: 'zzboard' - host: 121.40.189.20 - port: 6389 +# database: 5 +# host: 121.40.189.20 +# port: 6389 + database: 9 + host: 192.168.50.9 + port: 7379 + password: 'zzboard' main: allow-circular-references: true @@ -235,7 +232,7 @@ spring: rabbitmq: host: 192.168.50.9 port: 5672 - virtual-host: /qomoflow-dev + virtual-host: /qomoflow-standardcost username: admin password: kncloud connection-timeout: 5000 @@ -260,7 +257,7 @@ mybatis-plus: configuration: # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用 log-impl: org.apache.ibatis.logging.stdout.StdOutImpl -# log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl + # log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl # 返回类型为Map,显示null对应的字段 call-setters-on-nulls: true #jeecg专用配置 @@ -285,7 +282,8 @@ jeecg: #webapp文件路径 webapp: /opt/webapp shiro: -# excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/** +# excludeUrls: /api/**,/api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/** +# excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/** excludeUrls: /**/**,/**/**/** #阿里云oss存储和大鱼短信秘钥配置 @@ -294,11 +292,6 @@ jeecg: secretKey: ?? endpoint: oss-cn-beijing.aliyuncs.com bucketName: jeecgdev - minio: - minio_url: http://192.168.50.102:9000 - minio_name: admin - minio_pass: minioadmin - bucketName: bucket803 # ElasticSearch 6设置 elasticsearch: cluster-name: elasticsearch-cluster @@ -308,14 +301,15 @@ jeecg: task-data-struct-index: task_data_struct_dev/_doc task-data-temp-index: task_data_temp_dev/_doc task-log-index: task_log_dev/_doc + task-record-index: clean_data_record/_doc # 在线预览文件服务器地址配置 file-view-domain: http://fileview.jeecg.com # minio文件上传 -# minio: -# minio_url: http://minio.jeecg.com -# minio_name: ?? -# minio_pass: ?? -# bucketName: otatest + minio: + minio_url: http://minio.jeecg.com + minio_name: ?? + minio_pass: ?? + bucketName: otatest #大屏报表参数设置 jmreport: mode: dev @@ -438,19 +432,17 @@ flowable: Qomo: version: @project.version@ -modelPath: /opt/services/deploy-jars/algo/model +modelPath: /opt/deploy/qomo/backend/algo/model seaTunnelHome: /opt/service/apache-seatunnel-2.3.4 hiveMetastoreUri: thrift://192.168.50.102:9083 +hiveSitePath: /opt/service/apache-seatunnel-2.3.4/deploy/hive-site.xml +hdfsSitePath: /opt/service/apache-seatunnel-2.3.4/deploy/hdfs-site.xml minio: - server: http://192.168.50.102 - port: 9000 + server: http://192.168.50.9 + port: 9100 access-key: admin - secret-key: minioadmin - bucketName: bucket1 + secret-key: qm123456 condaEnv: py310 - -analysis: - consistency: - url: http://192.168.50.9:1314/analysis \ No newline at end of file +tikaServerUrl: http://192.168.50.99:8099/qomo-tika/ \ No newline at end of file diff --git a/qomo-kn-cost-manage/pom.xml b/qomo-kn-cost-manage/pom.xml index 63c79a0..7e5a041 100644 --- a/qomo-kn-cost-manage/pom.xml +++ b/qomo-kn-cost-manage/pom.xml @@ -2,42 +2,60 @@ + 4.0.0 com.zzsmart.qomo qomo-kn-forecast ${revision} - 4.0.0 - qomo-kn-cost-manage - - - 8 - 8 - UTF-8 - - org.qomo.boot qomo-system-biz - 2.0.1-SNAPSHOT + ${revision} - org.springframework.boot - spring-boot-test - test + org.projectlombok + lombok + provided - junit - junit - test + com.google.auto.service + auto-service + provided - com.baomidou - mybatis-plus-generator - 3.5.1 + com.zzsmart.qomo + qomo-data-integration + + + org.projectlombok + lombok + RELEASE + compile + + + org.apache.poi + poi + 5.2.3 + + + org.apache.poi + poi-ooxml + 5.2.3 + + + + + + + + + com.alibaba + easyexcel + 4.0.1 - + \ No newline at end of file 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 new file mode 100644 index 0000000..7078a5c --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostCountController.java @@ -0,0 +1,165 @@ +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.AppSceneCostCount; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostCountService; +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_count + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +@Api(tags = "cost-标准成本计算") +@RestController +@RequestMapping("//costCount") +@Slf4j +public class AppSceneCostCountController extends JeecgController { + @Autowired + private IAppSceneCostCountService appSceneCostCountService; + + /** + * 分页列表查询 + * + * @param appSceneCostCount + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_count-分页列表查询") + @ApiOperation(value = "标准成本计算-分页列表查询", notes = "标准成本计算-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppSceneCostCount appSceneCostCount, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostCount, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appSceneCostCountService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加标准成本计算任务 + * + * @param appSceneCostCount + * @return + */ + @AutoLog(value = "app_scene_cost_count-添加") + @ApiOperation(value = "添加标准成本计算任务", notes = "添加标准成本计算任务") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_count:addCostCountTask") + @PostMapping(value = "/addCostCountTask") + public Result addCostCountTask(@RequestBody AppSceneCostCount appSceneCostCount) { + appSceneCostCountService.addCostCountTask(appSceneCostCount); + return Result.OK("添加成功!"); + } + + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "app_scene_cost_count-通过id删除") + @ApiOperation(value = "标准成本计算-通过id删除", notes = "标准成本计算-通过id删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_count:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) String id) { + appSceneCostCountService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "app_scene_cost_count-批量删除") + @ApiOperation(value = "app_scene_cost_count-批量删除", notes = "app_scene_cost_count-批量删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_count:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name = "ids", required = true) String ids) { + this.appSceneCostCountService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 重新计算 + * + * @param id + * @return + */ + //@AutoLog(value = "app_scene_cost_count-通过id查询") + @ApiOperation(value = "标准成本计算-重新计算", notes = "标准成本计算-重新计算") + @GetMapping(value = "/recountById") + public Result recountById(@RequestParam(name = "id", required = true) Integer id) { + AppSceneCostCount appSceneCostCount = appSceneCostCountService.recountById(id); + if (appSceneCostCount == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appSceneCostCount); + } + + /** + * 查看关键缺失部件 + * + * @param id + * @return + */ + //@AutoLog(value = "app_scene_cost_count-通过id查询") + @ApiOperation(value = "标准成本计算-查看关键缺失部件", notes = "标准成本计算-查看关键缺失部件") + @GetMapping(value = "/queryMissingComponentById") + public Result queryMissingComponentById(@RequestParam(name = "id", required = true) String id) { + AppSceneCostCount appSceneCostCount = appSceneCostCountService.queryMissingComponentById(id); + if (appSceneCostCount == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appSceneCostCount); + } + + /** + * 导出excel + * + * @param request + * @param appSceneCostCount + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_count:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AppSceneCostCount appSceneCostCount) { + return super.exportXls(request, appSceneCostCount, AppSceneCostCount.class, "app_scene_cost_count"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_count:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, AppSceneCostCount.class); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java new file mode 100644 index 0000000..8652f67 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostModelController.java @@ -0,0 +1,115 @@ +package com.zzsmart.qomo.kn.cost.manage.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +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.AppSceneCostModel; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostModelService; +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.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_model + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +@Api(tags = "cost-标准成本-模型管理") +@RestController +@RequestMapping("//cost-model") +@Slf4j +public class AppSceneCostModelController { + @Autowired + private IAppSceneCostModelService appSceneCostModelService; + @Autowired + private IDataFlowDefinitionService flowDefinitionService; + + /** + * 标准成本模型分页列表查询 + * + * @param flowDefinition + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_model-分页列表查询") + @ApiOperation(value = "标准成本模型分页列表查询", notes = "标准成本模型分页列表查询") + @GetMapping(value = "/pageList") + public Result> queryPageList(FlowDefinition flowDefinition, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(flowDefinition, req.getParameterMap()); + Page page = new Page((long) pageNo, (long) pageSize); + LambdaQueryWrapper wrapper = queryWrapper.lambda(); + wrapper.orderByDesc(FlowDefinition::getCreateTime); + IPage pageList = flowDefinitionService.queryPageList(page, wrapper); + return Result.OK(pageList); + } + + @ApiOperation(value = "标准成本模型列表", notes = "标准成本模型列表") + @GetMapping(value = "/list") + public Result> queryList(FlowDefinition flowDefinition, HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(flowDefinition, req.getParameterMap()); + LambdaQueryWrapper wrapper = queryWrapper.lambda(); + wrapper.orderByDesc(FlowDefinition::getCreateTime); + List list = appSceneCostModelService.queryListResult(wrapper); + return Result.OK(list); + } + + /** + * 添加标准成本模型 + * + * @param flowDefinition + * @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 definition = flowDefinitionService.add(flowDefinition); + return Result.OK(definition); + } + + /** + * 编辑 + * + * @param flowDefinition + * @return + */ + @AutoLog(value = "app_scene_cost_model-编辑") + @ApiOperation(value = "app_scene_cost_model-编辑", notes = "app_scene_cost_model-编辑") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_model:edit") + @PostMapping(value = "/edit") + public Result edit(@RequestBody FlowDefinition flowDefinition) { + return Result.OK(flowDefinitionService.edit(flowDefinition)); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "app_scene_cost_model-通过id删除") + @ApiOperation(value = "app_scene_cost_model-通过id删除", notes = "app_scene_cost_model-通过id删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_model:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name = "id", required = true) Integer id) { + flowDefinitionService.delete(id); + return Result.OK("删除成功!"); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostResultValueController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostResultValueController.java new file mode 100644 index 0000000..fecbd6a --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/AppSceneCostResultValueController.java @@ -0,0 +1,179 @@ +package com.zzsmart.qomo.kn.cost.manage.controller; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostResultValue; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostResultValueService; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.oConvertUtils; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; + + /** + * @Description: app_scene_cost_result_value + * @Author: jeecg-boot + * @Date: 2024-07-23 + * @Version: V1.0 + */ +@Api(tags="app_scene_cost_result_value") +@RestController +@RequestMapping("/com.zzsmart.qomo.kn.cost.manage/appSceneCostResultValue") +@Slf4j +public class AppSceneCostResultValueController extends JeecgController { + @Autowired + private IAppSceneCostResultValueService appSceneCostResultValueService; + + /** + * 分页列表查询 + * + * @param appSceneCostResultValue + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "app_scene_cost_result_value-分页列表查询") + @ApiOperation(value="app_scene_cost_result_value-分页列表查询", notes="app_scene_cost_result_value-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppSceneCostResultValue appSceneCostResultValue, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostResultValue, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appSceneCostResultValueService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param appSceneCostResultValue + * @return + */ + @AutoLog(value = "app_scene_cost_result_value-添加") + @ApiOperation(value="app_scene_cost_result_value-添加", notes="app_scene_cost_result_value-添加") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:add") + @PostMapping(value = "/add") + public Result add(@RequestBody AppSceneCostResultValue appSceneCostResultValue) { + appSceneCostResultValueService.save(appSceneCostResultValue); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param appSceneCostResultValue + * @return + */ + @AutoLog(value = "app_scene_cost_result_value-编辑") + @ApiOperation(value="app_scene_cost_result_value-编辑", notes="app_scene_cost_result_value-编辑") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody AppSceneCostResultValue appSceneCostResultValue) { + appSceneCostResultValueService.updateById(appSceneCostResultValue); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "app_scene_cost_result_value-通过id删除") + @ApiOperation(value="app_scene_cost_result_value-通过id删除", notes="app_scene_cost_result_value-通过id删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + appSceneCostResultValueService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "app_scene_cost_result_value-批量删除") + @ApiOperation(value="app_scene_cost_result_value-批量删除", notes="app_scene_cost_result_value-批量删除") + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.appSceneCostResultValueService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "app_scene_cost_result_value-通过id查询") + @ApiOperation(value="app_scene_cost_result_value-通过id查询", notes="app_scene_cost_result_value-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValueService.getById(id); + if(appSceneCostResultValue==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appSceneCostResultValue); + } + + /** + * 导出excel + * + * @param request + * @param appSceneCostResultValue + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AppSceneCostResultValue appSceneCostResultValue) { + return super.exportXls(request, appSceneCostResultValue, AppSceneCostResultValue.class, "app_scene_cost_result_value"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_result_value:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, AppSceneCostResultValue.class); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/BomTreeController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/BomTreeController.java index 1a392ef..aa69f80 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/BomTreeController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/BomTreeController.java @@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RestController; import java.util.List; -@Api(tags = "结构树查询") +@Api(tags = "cost-结构树查询") @RestController @RequestMapping("//bomTree") @Slf4j @@ -24,7 +24,7 @@ public class BomTreeController { @ApiOperation(value = "结构树查询", notes = "结构树查询") @GetMapping(value = "/queryBomTree") - public Result queryBomTree(@RequestParam(name = "materialNumber", required = false) String materialNumber, @RequestParam(name = "versionNumber", required = false) String versionNumber) { + public Result> queryBomTree(@RequestParam(name = "materialNumber", required = false) String materialNumber, @RequestParam(name = "versionNumber", required = false) String versionNumber) { List bomTreeInfoVOS = bomTreeService.getBomTreeByMaterialNumber(materialNumber, versionNumber); return Result.OK(bomTreeInfoVOS); } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/BudgetPriceController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/BudgetPriceController.java deleted file mode 100644 index f2b62b8..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/BudgetPriceController.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.common.util.oConvertUtils; -import com.zzsmart.qomo.kn.cost.manage.entity.BudgetPrice; -import com.zzsmart.qomo.kn.cost.manage.service.IBudgetPriceService; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; - -import org.jeecgframework.poi.excel.ExcelImportUtil; -import org.jeecgframework.poi.excel.def.NormalExcelConstants; -import org.jeecgframework.poi.excel.entity.ExportParams; -import org.jeecgframework.poi.excel.entity.ImportParams; -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; -import org.jeecg.common.system.base.controller.JeecgController; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; -import com.alibaba.fastjson.JSON; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.jeecg.common.aspect.annotation.AutoLog; -import org.apache.shiro.authz.annotation.RequiresPermissions; - - /** - * @Description: budget_price - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -@Api(tags="预算价格") -@RestController -@RequestMapping("//budgetPrice") -@Slf4j -public class BudgetPriceController extends JeecgController { - @Autowired - private IBudgetPriceService budgetPriceService; - - /** - * 分页列表查询 - * - * @param budgetPrice - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "budget_price-分页列表查询") - @ApiOperation(value="budget_price-分页列表查询", notes="budget_price-分页列表查询") - @GetMapping(value = "/list") - public Result> queryPageList(BudgetPrice budgetPrice, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(budgetPrice, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = budgetPriceService.page(page, queryWrapper); - return Result.OK(pageList); - } - - /** - * 添加 - * - * @param budgetPrice - * @return - */ - @AutoLog(value = "budget_price-添加") - @ApiOperation(value="budget_price-添加", notes="budget_price-添加") - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:budget_price:add") - @PostMapping(value = "/add") - public Result add(@RequestBody BudgetPrice budgetPrice) { - budgetPriceService.save(budgetPrice); - return Result.OK("添加成功!"); - } - - /** - * 编辑 - * - * @param budgetPrice - * @return - */ - @AutoLog(value = "budget_price-编辑") - @ApiOperation(value="budget_price-编辑", notes="budget_price-编辑") - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:budget_price:edit") - @RequestMapping(value = "/edit", method = {RequestMethod.POST}) - public Result edit(@RequestBody BudgetPrice budgetPrice) { - budgetPriceService.updateById(budgetPrice); - return Result.OK("编辑成功!"); - } - - /** - * 通过id删除 - * - * @param id - * @return - */ - @AutoLog(value = "budget_price-通过id删除") - @ApiOperation(value="budget_price-通过id删除", notes="budget_price-通过id删除") - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:budget_price:delete") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { - budgetPriceService.removeById(id); - return Result.OK("删除成功!"); - } - - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "budget_price-批量删除") - @ApiOperation(value="budget_price-批量删除", notes="budget_price-批量删除") - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:budget_price:deleteBatch") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.budgetPriceService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - //@AutoLog(value = "budget_price-通过id查询") - @ApiOperation(value="budget_price-通过id查询", notes="budget_price-通过id查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { - BudgetPrice budgetPrice = budgetPriceService.getById(id); - if(budgetPrice==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(budgetPrice); - } - - /** - * 导出excel - * - * @param request - * @param budgetPrice - */ - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:budget_price:exportXls") - @GetMapping(value = "/exportXls") - @ApiOperation(value="导出excel", notes="导出excel") - public ModelAndView exportXls(HttpServletRequest request, BudgetPrice budgetPrice) { - return super.exportXls(request, budgetPrice, BudgetPrice.class, "budget_price"); - } - - /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ - @ApiOperation(value="excel导入数据", notes="excel导入数据") - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:budget_price:importExcel") - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result importExcel(HttpServletRequest request, HttpServletResponse response) { - return super.importExcel(request, response, BudgetPrice.class); - } - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/C7525costController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/C7525costController.java deleted file mode 100644 index 6fe285c..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/C7525costController.java +++ /dev/null @@ -1,182 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.zzsmart.qomo.kn.cost.manage.entity.C7525cost; -import com.zzsmart.qomo.kn.cost.manage.service.IC7525costService; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.common.util.oConvertUtils; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; - -import org.jeecgframework.poi.excel.ExcelImportUtil; -import org.jeecgframework.poi.excel.def.NormalExcelConstants; -import org.jeecgframework.poi.excel.entity.ExportParams; -import org.jeecgframework.poi.excel.entity.ImportParams; -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; -import org.jeecg.common.system.base.controller.JeecgController; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; -import com.alibaba.fastjson.JSON; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.jeecg.common.aspect.annotation.AutoLog; -import org.apache.shiro.authz.annotation.RequiresPermissions; - - /** - * @Description: c7525cost - * @Author: jeecg-boot - * @Date: 2024-06-06 - * @Version: V1.0 - */ -@Api(tags="7525单价") -@RestController -@RequestMapping("//c7525cost") -@Slf4j -public class C7525costController extends JeecgController { - @Autowired - private IC7525costService c7525costService; - - /** - * 分页列表查询 - * - * @param c7525cost - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "c7525cost-分页列表查询") - @ApiOperation(value="c7525cost-分页列表查询", notes="c7525cost-分页列表查询") - @GetMapping(value = "/list") - public Result> queryPageList(C7525cost c7525cost, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(c7525cost, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = c7525costService.page(page, queryWrapper); - return Result.OK(pageList); - } - - /** - * 添加 - * - * @param c7525cost - * @return - */ - @AutoLog(value = "c7525cost-添加") - @ApiOperation(value="c7525cost-添加", notes="c7525cost-添加") -// @RequiresPermissions(":c7525cost:add") - @PostMapping(value = "/add") - public Result add(@RequestBody C7525cost c7525cost) { - c7525costService.save(c7525cost); - return Result.OK("添加成功!"); - } - - /** - * 编辑 - * - * @param c7525cost - * @return - */ - @AutoLog(value = "c7525cost-编辑") - @ApiOperation(value="c7525cost-编辑", notes="c7525cost-编辑") -// @RequiresPermissions(":c7525cost:edit") - @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) - public Result edit(@RequestBody C7525cost c7525cost) { - c7525costService.updateById(c7525cost); - return Result.OK("编辑成功!"); - } - - /** - * 通过id删除 - * - * @param id - * @return - */ - @AutoLog(value = "c7525cost-通过id删除") - @ApiOperation(value="c7525cost-通过id删除", notes="c7525cost-通过id删除") -// @RequiresPermissions(":c7525cost:delete") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { - c7525costService.removeById(id); - return Result.OK("删除成功!"); - } - - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "c7525cost-批量删除") - @ApiOperation(value="c7525cost-批量删除", notes="c7525cost-批量删除") -// @RequiresPermissions(":c7525cost:deleteBatch") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.c7525costService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - //@AutoLog(value = "c7525cost-通过id查询") - @ApiOperation(value="c7525cost-通过id查询", notes="c7525cost-通过id查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { - C7525cost c7525cost = c7525costService.getById(id); - if(c7525cost==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(c7525cost); - } - - /** - * 导出excel - * - * @param request - * @param c7525cost - */ -// @RequiresPermissions(":c7525cost:exportXls") - @ApiOperation(value="c7525cost-导出excel", notes="c7525cost-导出excel") - @RequestMapping(value = "/exportXls", method = RequestMethod.GET) - public ModelAndView exportXls(HttpServletRequest request, C7525cost c7525cost) { - return super.exportXls(request, c7525cost, C7525cost.class, "c7525cost"); - } - - /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ -// @RequiresPermissions(":c7525cost:importExcel") - @ApiOperation(value="c7525cost-通过excel导入数据", notes="c7525cost-通过excel导入数据") - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result importExcel(HttpServletRequest request, HttpServletResponse response) { - return super.importExcel(request, response, C7525cost.class); - } - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostCenterController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostCenterController.java deleted file mode 100644 index 8e69565..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostCenterController.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.common.util.oConvertUtils; -import com.zzsmart.qomo.kn.cost.manage.entity.CostCenter; -import com.zzsmart.qomo.kn.cost.manage.service.ICostCenterService; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; - -import org.jeecgframework.poi.excel.ExcelImportUtil; -import org.jeecgframework.poi.excel.def.NormalExcelConstants; -import org.jeecgframework.poi.excel.entity.ExportParams; -import org.jeecgframework.poi.excel.entity.ImportParams; -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; -import org.jeecg.common.system.base.controller.JeecgController; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; -import com.alibaba.fastjson.JSON; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.jeecg.common.aspect.annotation.AutoLog; -import org.apache.shiro.authz.annotation.RequiresPermissions; - - /** - * @Description: cost_center - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -@Api(tags="成本中心") -@RestController -@RequestMapping("/com.zzsmart.qomo.kn.cost.manage/costCenter") -@Slf4j -public class CostCenterController extends JeecgController { - @Autowired - private ICostCenterService costCenterService; - - /** - * 分页列表查询 - * - * @param costCenter - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "cost_center-分页列表查询") - @ApiOperation(value="cost_center-分页列表查询", notes="cost_center-分页列表查询") - @GetMapping(value = "/list") - public Result> queryPageList(CostCenter costCenter, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(costCenter, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = costCenterService.page(page, queryWrapper); - return Result.OK(pageList); - } - - /** - * 添加 - * - * @param costCenter - * @return - */ - @AutoLog(value = "cost_center-添加") - @ApiOperation(value="cost_center-添加", notes="cost_center-添加") - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:cost_center:add") - @PostMapping(value = "/add") - public Result add(@RequestBody CostCenter costCenter) { - costCenterService.save(costCenter); - return Result.OK("添加成功!"); - } - - /** - * 编辑 - * - * @param costCenter - * @return - */ - @AutoLog(value = "cost_center-编辑") - @ApiOperation(value="cost_center-编辑", notes="cost_center-编辑") - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:cost_center:edit") - @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) - public Result edit(@RequestBody CostCenter costCenter) { - costCenterService.updateById(costCenter); - return Result.OK("编辑成功!"); - } - - /** - * 通过id删除 - * - * @param id - * @return - */ - @AutoLog(value = "cost_center-通过id删除") - @ApiOperation(value="cost_center-通过id删除", notes="cost_center-通过id删除") - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:cost_center:delete") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { - costCenterService.removeById(id); - return Result.OK("删除成功!"); - } - - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "cost_center-批量删除") - @ApiOperation(value="cost_center-批量删除", notes="cost_center-批量删除") - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:cost_center:deleteBatch") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.costCenterService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - //@AutoLog(value = "cost_center-通过id查询") - @ApiOperation(value="cost_center-通过id查询", notes="cost_center-通过id查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { - CostCenter costCenter = costCenterService.getById(id); - if(costCenter==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(costCenter); - } - - /** - * 导出excel - * - * @param request - * @param costCenter - */ - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:cost_center:exportXls") - @RequestMapping(value = "/exportXls") - public ModelAndView exportXls(HttpServletRequest request, CostCenter costCenter) { - return super.exportXls(request, costCenter, CostCenter.class, "cost_center"); - } - - /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:cost_center:importExcel") - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result importExcel(HttpServletRequest request, HttpServletResponse response) { - return super.importExcel(request, response, CostCenter.class); - } - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostMaterialBomController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostMaterialBomController.java index aded9ae..00ec80c 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostMaterialBomController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostMaterialBomController.java @@ -1,20 +1,70 @@ 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.CostMaterialBom; +import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion; +import com.zzsmart.qomo.kn.cost.manage.service.CostMaterialBomService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.springframework.beans.factory.annotation.Autowired; +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 java.util.List; + /** *

* 物料bom 前端控制器 *

* - * @author - * @since 2024-06-19 + * @author + * @since 2024-06-21 */ +@RequestMapping("//cost-material-bom") +@Api(tags="cost-标准成本-bom信息") @RestController -@RequestMapping("/cost-material-bom") public class CostMaterialBomController { - + @Autowired + CostMaterialBomService 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(CostMaterialBom 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< List> queryList(@RequestParam(name = "materialNumber",required = false) String materialNumber) { + List list = costMaterialBomService.queryListResult(materialNumber); + return Result.OK(list); + } } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostPartMissingInfoController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostPartMissingInfoController.java index bb6720b..b2e432c 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostPartMissingInfoController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostPartMissingInfoController.java @@ -44,7 +44,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; * @Date: 2024-06-13 * @Version: V1.0 */ -@Api(tags="标准成本-部件缺失信息") +@Api(tags="cost-标准成本-部件缺失信息") @RestController @RequestMapping("//costPartMissingInfo") @Slf4j @@ -61,8 +61,8 @@ public class CostPartMissingInfoController extends JeecgController> queryPageList(CostPartMissingInfo costPartMissingInfo, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @@ -80,9 +80,9 @@ public class CostPartMissingInfoController extends JeecgController add(@RequestBody CostPartMissingInfo costPartMissingInfo) { costPartMissingInfoService.save(costPartMissingInfo); @@ -95,9 +95,9 @@ public class CostPartMissingInfoController extends JeecgController edit(@RequestBody CostPartMissingInfo costPartMissingInfo) { costPartMissingInfoService.updateById(costPartMissingInfo); @@ -110,9 +110,9 @@ public class CostPartMissingInfoController extends JeecgController delete(@RequestParam(name="id",required=true) String id) { costPartMissingInfoService.removeById(id); @@ -125,9 +125,9 @@ public class CostPartMissingInfoController extends JeecgController deleteBatch(@RequestParam(name="ids",required=true) String ids) { this.costPartMissingInfoService.removeByIds(Arrays.asList(ids.split(","))); @@ -140,8 +140,8 @@ public class CostPartMissingInfoController extends JeecgController queryById(@RequestParam(name="id",required=true) String id) { CostPartMissingInfo costPartMissingInfo = costPartMissingInfoService.getById(id); @@ -157,10 +157,10 @@ public class CostPartMissingInfoController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { return super.importExcel(request, response, CostPartMissingInfo.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardController.java deleted file mode 100644 index 9b5e564..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardController.java +++ /dev/null @@ -1,237 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - -import java.io.InputStream; -import java.net.URL; -import java.net.URLEncoder; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandard; -import com.zzsmart.qomo.kn.cost.manage.service.ICostStandardService; -import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardVO; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.ss.util.CellRangeAddressList; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.common.util.oConvertUtils; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; - -import org.jeecg.modules.system.entity.SysUser; -import org.jeecgframework.poi.excel.ExcelImportUtil; -import org.jeecgframework.poi.excel.def.NormalExcelConstants; -import org.jeecgframework.poi.excel.entity.ExportParams; -import org.jeecgframework.poi.excel.entity.ImportParams; -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; -import org.jeecg.common.system.base.controller.JeecgController; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; -import com.alibaba.fastjson.JSON; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.jeecg.common.aspect.annotation.AutoLog; -import org.apache.shiro.authz.annotation.RequiresPermissions; - - /** - * @Description: 标准成本 - * @Author: wangqiong - * @Date: 2024-06-13 - * @Version: V1.0 - */ -@Api(tags="标准成本计算") -@RestController -@RequestMapping("//costStandard") -@Slf4j -public class CostStandardController extends JeecgController { - @Autowired - private ICostStandardService costStandardService; - - /** - * 分页列表查询 - * - * @param costStandard - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "cost_standard-分页列表查询") - @ApiOperation(value="cost_standard-分页列表查询", notes="cost_standard-分页列表查询") - @GetMapping(value = "/list") - public Result> queryPageList(CostStandardVO costStandard, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - - Page page = new Page(pageNo, pageSize); - IPage pageList = costStandardService.pageList(page, costStandard); - return Result.OK(pageList); - } - - /** - * 添加 - * - * @param costStandard - * @return - */ - @AutoLog(value = "cost_standard-添加") - @ApiOperation(value="cost_standard-添加", notes="cost_standard-添加") -// @RequiresPermissions(":cost_standard:add") - @PostMapping(value = "/add") - public Result add(@RequestBody CostStandard costStandard) { - costStandardService.save(costStandard); - return Result.OK("添加成功!"); - } - - - /** - * 编辑 - * - * @param costStandard - * @return - */ - @AutoLog(value = "cost_standard-编辑") - @ApiOperation(value="cost_standard-编辑", notes="cost_standard-编辑") -// @RequiresPermissions(":cost_standard:edit") - @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) - public Result edit(@RequestBody CostStandard costStandard) { - costStandardService.updateById(costStandard); - return Result.OK("编辑成功!"); - } - - /** - * 通过id删除 - * - * @param id - * @return - */ - @AutoLog(value = "cost_standard-通过id删除") - @ApiOperation(value="cost_standard-通过id删除", notes="cost_standard-通过id删除") -// @RequiresPermissions(":cost_standard:delete") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { - costStandardService.removeById(id); - return Result.OK("删除成功!"); - } - - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "cost_standard-批量删除") - @ApiOperation(value="cost_standard-批量删除", notes="cost_standard-批量删除") -// @RequiresPermissions(":cost_standard:deleteBatch") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.costStandardService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - //@AutoLog(value = "cost_standard-通过id查询") - @ApiOperation(value="cost_standard-通过id查询", notes="cost_standard-通过id查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { - CostStandard costStandard = costStandardService.getById(id); - if(costStandard==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(costStandard); - } - - /** - * 导出excel - * - * @param request - * @param costStandard - */ -// @RequiresPermissions(":cost_standard:exportXls") - @RequestMapping(value = "/exportXls", method = RequestMethod.GET) - public ModelAndView exportXls(HttpServletRequest request, CostStandard costStandard) { - return super.exportXls(request, costStandard, CostStandard.class, "cost_standard"); - } - - /** - * 通过excel导入数据并进行批量计算 - * - * @param request - * @param response - * @return - */ -// @RequiresPermissions(":cost_standard:importExcel") - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result importExcel(HttpServletRequest request, HttpServletResponse response) { - return super.importExcel(request, response, CostStandard.class); - } - - @GetMapping("/download/excel-template") - public void downloadExcel(HttpServletResponse response) throws IOException { - // 创建工作簿 - Workbook workbook = new XSSFWorkbook(); - Sheet sheet = workbook.createSheet("生变成版本号导入模板"); - - // 创建表头行 - Row headerRow = sheet.createRow(0); - // 设置字体 - Font headerFont = workbook.createFont(); - headerFont.setBold(true); // 设置字体为加粗 - // headerFont.setFontHeightInPoints((short) 14); // 设置字体大小 - - CellStyle headerCellStyle = workbook.createCellStyle(); - headerCellStyle.setFont(headerFont); - Cell firstCell = headerRow.createCell(0); - firstCell.setCellStyle(headerCellStyle); - firstCell.setCellValue("物料号"); - Cell secondCell = headerRow.createCell(1); - secondCell.setCellStyle(headerCellStyle); - secondCell.setCellValue("图号"); - Cell thirdCell = headerRow.createCell(2); - thirdCell.setCellStyle(headerCellStyle); - thirdCell.setCellValue("项目阶段"); - - // 设置下拉列表数据 - DataValidationHelper validationHelper = sheet.getDataValidationHelper(); - DataValidationConstraint constraint = validationHelper.createExplicitListConstraint( - new String[]{"初始","首批","量产"}); // 下拉列表的选项 - - // 应用下拉列表到第三列(索引为2) - CellRangeAddressList addressList = new CellRangeAddressList(1, 65535, 2, 2); // 从第二行开始到第101行,第三列 - DataValidation validation = validationHelper.createValidation(constraint, addressList); - sheet.addValidationData(validation); - - - - // 设置响应头 - response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); - response.setHeader("Content-Disposition", "attachment; filename=example-template.xlsx"); - - // 将工作簿写入输出流 - workbook.write(response.getOutputStream()); - workbook.close(); - - response.flushBuffer(); - } - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardDetailController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardDetailController.java index af3393b..2b7586e 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardDetailController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardDetailController.java @@ -1,38 +1,38 @@ package com.zzsmart.qomo.kn.cost.manage.controller; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardDetail; import com.zzsmart.qomo.kn.cost.manage.service.CostStandardDetailService; -import com.zzsmart.qomo.kn.cost.manage.service.ICostStandardService; +import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailSearch; import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailVO; -import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardVO; 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.springframework.beans.factory.annotation.Autowired; -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 org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; /** *

* 标准成本明细表 前端控制器 *

* - * @author cost_purchase_price + * @author app_scene_cost_purchase_price * @since 2024-06-19 */ -@Api(tags="标准成本单行查询") +@Api(tags = "cost-标准成本单行查询") @RestController @RequestMapping("//costStandardDetail") @Slf4j -public class CostStandardDetailController { +public class CostStandardDetailController extends JeecgController { @Autowired private CostStandardDetailService costStandardDetailService; @@ -45,16 +45,26 @@ public class CostStandardDetailController { * @param req * @return */ - //@AutoLog(value = "cost_standard-分页列表查询") - @ApiOperation(value="cost_standard_detail-分页列表查询", notes="cost_standard_detail-分页列表查询") + //@AutoLog(value = "标准成本单行列表查询") + @ApiOperation(value = "标准成本单行列表查询", notes = "标准成本单行列表查询") @GetMapping(value = "/list") - public Result> queryPageList(CostStandardDetailVO costStandard, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { + public Result> queryPageList(CostStandardDetailVO costStandard, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) { Page page = new Page(pageNo, pageSize); IPage pageList = costStandardDetailService.pageList(page, costStandard); return Result.OK(pageList); } + + /** + * 导出excel + * + * @param request + * @param costStandardDetailSearch + */ + @RequestMapping(value = "/exportXls", method = RequestMethod.GET) + @ApiOperation(value = "单行查询导出", notes = "单行查询导出") + public Result exportXls(HttpServletRequest request, HttpServletResponse response, CostStandardDetailSearch costStandardDetailSearch) throws IOException { + JSONObject result = costStandardDetailService.exportExcel(request, response, costStandardDetailSearch); + return Result.OK(result); + } } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardVersionController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardVersionController.java index 1c45c9e..29537bc 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardVersionController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/CostStandardVersionController.java @@ -2,51 +2,34 @@ package com.zzsmart.qomo.kn.cost.manage.controller; import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandard; import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion; import com.zzsmart.qomo.kn.cost.manage.service.ICostStandardVersionService; -import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardVO; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.common.util.oConvertUtils; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; -import org.jeecgframework.poi.excel.ExcelImportUtil; -import org.jeecgframework.poi.excel.def.NormalExcelConstants; -import org.jeecgframework.poi.excel.entity.ExportParams; -import org.jeecgframework.poi.excel.entity.ImportParams; -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.jeecg.common.system.base.controller.JeecgController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; -import com.alibaba.fastjson.JSON; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.jeecg.common.aspect.annotation.AutoLog; -import org.apache.shiro.authz.annotation.RequiresPermissions; - /** +/** * @Description: 标准成本-版本号 * @Author: wangqiong * @Date: 2024-06-13 * @Version: V1.0 */ -@Api(tags="标准成本-版本号") +@Api(tags="cost-标准成本-版本号") @RestController @RequestMapping("//costStandardVersion") @Slf4j @@ -63,9 +46,9 @@ public class CostStandardVersionController extends JeecgController> queryPageList(CostStandardVersion costStandardVersion, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @@ -75,16 +58,26 @@ public class CostStandardVersionController extends JeecgController pageList = costStandardVersionService.page(page, queryWrapper); return Result.OK(pageList); } - + /** + * 列表查询 + * + * @return + */ + @ApiOperation(value="版本号列表查询", notes="版本号列表查询") + @GetMapping(value = "/list") + public Result< List> queryList(@RequestParam(name = "versionNumber",required = false) String versionNumber) { + List list = costStandardVersionService.queryListResult(versionNumber); + return Result.OK(list); + } /** * 添加 * * @param costStandardVersion * @return */ - @AutoLog(value = "cost_standard_version-添加") - @ApiOperation(value="cost_standard_version-添加", notes="cost_standard_version-添加") -// @RequiresPermissions(":cost_standard_version:add") + @AutoLog(value = "app_scene_cost_standard_version-添加") + @ApiOperation(value="app_scene_cost_standard_version-添加", notes="app_scene_cost_standard_version-添加") +// @RequiresPermissions(":app_scene_cost_standard_version:add") @PostMapping(value = "/add") public Result add(@RequestBody CostStandardVersion costStandardVersion) { boolean save = costStandardVersionService.save(costStandardVersion); @@ -101,9 +94,9 @@ public class CostStandardVersionController extends JeecgController edit(@RequestBody CostStandardVersion costStandardVersion) { costStandardVersionService.updateById(costStandardVersion); @@ -116,9 +109,9 @@ public class CostStandardVersionController extends JeecgController delete(@RequestParam(name="id",required=true) String id) { costStandardVersionService.removeById(id); @@ -131,9 +124,9 @@ public class CostStandardVersionController extends JeecgController deleteBatch(@RequestParam(name="ids",required=true) String ids) { this.costStandardVersionService.removeByIds(Arrays.asList(ids.split(","))); @@ -146,8 +139,8 @@ public class CostStandardVersionController extends JeecgController queryById(@RequestParam(name="id",required=true) String id) { CostStandardVersion costStandardVersion = costStandardVersionService.getById(id); @@ -163,10 +156,10 @@ public class CostStandardVersionController extends JeecgController importExcel(HttpServletRequest request, HttpServletResponse response) { return this.costStandardVersionService.importExcel(request, response, CostStandardVersion.class); diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/HourRateController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/HourRateController.java index abc6508..bc449eb 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/HourRateController.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/HourRateController.java @@ -27,7 +27,7 @@ import java.util.Arrays; * @Date: 2024-06-06 * @Version: V1.0 */ -@Api(tags="小时费率") +@Api(tags="cost-小时费率") @RestController @RequestMapping("//hourRate") @Slf4j diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/LatestPurchasePriceController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/LatestPurchasePriceController.java deleted file mode 100644 index b73ea7d..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/LatestPurchasePriceController.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.zzsmart.qomo.kn.cost.manage.entity.LatestPurchasePrice; -import com.zzsmart.qomo.kn.cost.manage.service.ILatestPurchasePriceService; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.common.util.oConvertUtils; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; - -import org.jeecgframework.poi.excel.ExcelImportUtil; -import org.jeecgframework.poi.excel.def.NormalExcelConstants; -import org.jeecgframework.poi.excel.entity.ExportParams; -import org.jeecgframework.poi.excel.entity.ImportParams; -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; -import org.jeecg.common.system.base.controller.JeecgController; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; -import com.alibaba.fastjson.JSON; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.jeecg.common.aspect.annotation.AutoLog; -import org.apache.shiro.authz.annotation.RequiresPermissions; - - /** - * @Description: latest_purchase_price - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -@Api(tags="最新采购价") -@RestController -@RequestMapping("//latestPurchasePrice") -@Slf4j -public class LatestPurchasePriceController extends JeecgController { - @Autowired - private ILatestPurchasePriceService latestPurchasePriceService; - - /** - * 分页列表查询 - * - * @param latestPurchasePrice - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "latest_purchase_price-分页列表查询") - @ApiOperation(value="latest_purchase_price-分页列表查询", notes="latest_purchase_price-分页列表查询") - @GetMapping(value = "/list") - public Result> queryPageList(LatestPurchasePrice latestPurchasePrice, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(latestPurchasePrice, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = latestPurchasePriceService.page(page, queryWrapper); - return Result.OK(pageList); - } - - /** - * 添加 - * - * @param latestPurchasePrice - * @return - */ - @AutoLog(value = "latest_purchase_price-添加") - @ApiOperation(value="latest_purchase_price-添加", notes="latest_purchase_price-添加") -// @RequiresPermissions(":latest_purchase_price:add") - @PostMapping(value = "/add") - public Result add(@RequestBody LatestPurchasePrice latestPurchasePrice) { - latestPurchasePriceService.save(latestPurchasePrice); - return Result.OK("添加成功!"); - } - - /** - * 编辑 - * - * @param latestPurchasePrice - * @return - */ - @AutoLog(value = "latest_purchase_price-编辑") - @ApiOperation(value="latest_purchase_price-编辑", notes="latest_purchase_price-编辑") -// @RequiresPermissions(":latest_purchase_price:edit") - @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) - public Result edit(@RequestBody LatestPurchasePrice latestPurchasePrice) { - latestPurchasePriceService.updateById(latestPurchasePrice); - return Result.OK("编辑成功!"); - } - - /** - * 通过id删除 - * - * @param id - * @return - */ - @AutoLog(value = "latest_purchase_price-通过id删除") - @ApiOperation(value="latest_purchase_price-通过id删除", notes="latest_purchase_price-通过id删除") -// @RequiresPermissions(":latest_purchase_price:delete") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { - latestPurchasePriceService.removeById(id); - return Result.OK("删除成功!"); - } - - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "latest_purchase_price-批量删除") - @ApiOperation(value="latest_purchase_price-批量删除", notes="latest_purchase_price-批量删除") -// @RequiresPermissions(":latest_purchase_price:deleteBatch") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.latestPurchasePriceService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - //@AutoLog(value = "latest_purchase_price-通过id查询") - @ApiOperation(value="latest_purchase_price-通过id查询", notes="latest_purchase_price-通过id查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { - LatestPurchasePrice latestPurchasePrice = latestPurchasePriceService.getById(id); - if(latestPurchasePrice==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(latestPurchasePrice); - } - - /** - * 导出excel - * - * @param request - * @param latestPurchasePrice - */ - @RequiresPermissions(":latest_purchase_price:exportXls") - @RequestMapping(value = "/exportXls", method = RequestMethod.GET) - public ModelAndView exportXls(HttpServletRequest request, LatestPurchasePrice latestPurchasePrice) { - return super.exportXls(request, latestPurchasePrice, LatestPurchasePrice.class, "latest_purchase_price"); - } - - /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ -// @RequiresPermissions(":latest_purchase_price:importExcel") - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result importExcel(HttpServletRequest request, HttpServletResponse response) { - return super.importExcel(request, response, LatestPurchasePrice.class); - } - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/ProduceBatchController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/ProduceBatchController.java deleted file mode 100644 index 3844db9..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/ProduceBatchController.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.zzsmart.qomo.kn.cost.manage.entity.ProduceBatch; -import com.zzsmart.qomo.kn.cost.manage.service.IProduceBatchService; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.common.util.oConvertUtils; - - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; - -import org.jeecgframework.poi.excel.ExcelImportUtil; -import org.jeecgframework.poi.excel.def.NormalExcelConstants; -import org.jeecgframework.poi.excel.entity.ExportParams; -import org.jeecgframework.poi.excel.entity.ImportParams; -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; -import org.jeecg.common.system.base.controller.JeecgController; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; -import com.alibaba.fastjson.JSON; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.jeecg.common.aspect.annotation.AutoLog; -import org.apache.shiro.authz.annotation.RequiresPermissions; - - /** - * @Description: produce_batch - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -@Api(tags="生产批量设置") -@RestController -@RequestMapping("//produceBatch") -@Slf4j -public class ProduceBatchController extends JeecgController { - @Autowired - private IProduceBatchService produceBatchService; - - /** - * 分页列表查询 - * - * @param produceBatch - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "produce_batch-分页列表查询") - @ApiOperation(value="produce_batch-分页列表查询", notes="produce_batch-分页列表查询") - @GetMapping(value = "/list") - public Result> queryPageList(ProduceBatch produceBatch, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(produceBatch, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = produceBatchService.page(page, queryWrapper); - return Result.OK(pageList); - } - - /** - * 添加 - * - * @param produceBatch - * @return - */ - @AutoLog(value = "produce_batch-添加") - @ApiOperation(value="produce_batch-添加", notes="produce_batch-添加") -// @RequiresPermissions(":produce_batch:add") - @PostMapping(value = "/add") - public Result add(@RequestBody ProduceBatch produceBatch) { - produceBatchService.save(produceBatch); - return Result.OK("添加成功!"); - } - - /** - * 编辑 - * - * @param produceBatch - * @return - */ - @AutoLog(value = "produce_batch-编辑") - @ApiOperation(value="produce_batch-编辑", notes="produce_batch-编辑") -// @RequiresPermissions(":produce_batch:edit") - @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) - public Result edit(@RequestBody ProduceBatch produceBatch) { - produceBatchService.updateById(produceBatch); - return Result.OK("编辑成功!"); - } - - /** - * 通过id删除 - * - * @param id - * @return - */ - @AutoLog(value = "produce_batch-通过id删除") - @ApiOperation(value="produce_batch-通过id删除", notes="produce_batch-通过id删除") -// @RequiresPermissions(":produce_batch:delete") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { - produceBatchService.removeById(id); - return Result.OK("删除成功!"); - } - - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "produce_batch-批量删除") - @ApiOperation(value="produce_batch-批量删除", notes="produce_batch-批量删除") -// @RequiresPermissions(":produce_batch:deleteBatch") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.produceBatchService.removeByIds(Arrays.asList(ids.split(","))); - - return Result.OK("批量删除成功!"); - } - /** - * 通过id查询 - * - * @param id - * @return - */ - //@AutoLog(value = "produce_batch-通过id查询") - @ApiOperation(value="produce_batch-通过id查询", notes="produce_batch-通过id查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { - ProduceBatch produceBatch = produceBatchService.getById(id); - if(produceBatch==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(produceBatch); - } - - /** - * 导出excel - * - * @param request - * @param produceBatch - */ - @RequiresPermissions(":produce_batch:exportXls") - @RequestMapping(value = "/exportXls", method = RequestMethod.GET) - public ModelAndView exportXls(HttpServletRequest request, ProduceBatch produceBatch) { - return super.exportXls(request, produceBatch, ProduceBatch.class, "produce_batch"); - } - - /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ -// @RequiresPermissions(":produce_batch:importExcel") - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result importExcel(HttpServletRequest request, HttpServletResponse response) { - return super.importExcel(request, response, ProduceBatch.class); - } - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/SapSubfactoryController.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/SapSubfactoryController.java deleted file mode 100644 index c4b5a80..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/controller/SapSubfactoryController.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.controller; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.common.util.oConvertUtils; -import com.zzsmart.qomo.kn.cost.manage.entity.SapSubfactory; -import com.zzsmart.qomo.kn.cost.manage.service.ISapSubfactoryService; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; - -import org.jeecgframework.poi.excel.ExcelImportUtil; -import org.jeecgframework.poi.excel.def.NormalExcelConstants; -import org.jeecgframework.poi.excel.entity.ExportParams; -import org.jeecgframework.poi.excel.entity.ImportParams; -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; -import org.jeecg.common.system.base.controller.JeecgController; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import org.springframework.web.servlet.ModelAndView; -import com.alibaba.fastjson.JSON; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.jeecg.common.aspect.annotation.AutoLog; -import org.apache.shiro.authz.annotation.RequiresPermissions; - - /** - * @Description: sap_subfactory - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -@Api(tags="工厂信息") -@RestController -@RequestMapping("/com.zzsmart.qomo.kn.cost.manage/sapSubfactory") -@Slf4j -public class SapSubfactoryController extends JeecgController { - @Autowired - private ISapSubfactoryService sapSubfactoryService; - - /** - * 分页列表查询 - * - * @param sapSubfactory - * @param pageNo - * @param pageSize - * @param req - * @return - */ - //@AutoLog(value = "sap_subfactory-分页列表查询") - @ApiOperation(value="sap_subfactory-分页列表查询", notes="sap_subfactory-分页列表查询") - @GetMapping(value = "/list") - public Result> queryPageList(SapSubfactory sapSubfactory, - @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, - @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(sapSubfactory, req.getParameterMap()); - Page page = new Page(pageNo, pageSize); - IPage pageList = sapSubfactoryService.page(page, queryWrapper); - return Result.OK(pageList); - } - - /** - * 添加 - * - * @param sapSubfactory - * @return - */ - @AutoLog(value = "sap_subfactory-添加") - @ApiOperation(value="sap_subfactory-添加", notes="sap_subfactory-添加") - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:sap_subfactory:add") - @PostMapping(value = "/add") - public Result add(@RequestBody SapSubfactory sapSubfactory) { - sapSubfactoryService.save(sapSubfactory); - return Result.OK("添加成功!"); - } - - /** - * 编辑 - * - * @param sapSubfactory - * @return - */ - @AutoLog(value = "sap_subfactory-编辑") - @ApiOperation(value="sap_subfactory-编辑", notes="sap_subfactory-编辑") - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:sap_subfactory:edit") - @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) - public Result edit(@RequestBody SapSubfactory sapSubfactory) { - sapSubfactoryService.updateById(sapSubfactory); - return Result.OK("编辑成功!"); - } - - /** - * 通过id删除 - * - * @param id - * @return - */ - @AutoLog(value = "sap_subfactory-通过id删除") - @ApiOperation(value="sap_subfactory-通过id删除", notes="sap_subfactory-通过id删除") - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:sap_subfactory:delete") - @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { - sapSubfactoryService.removeById(id); - return Result.OK("删除成功!"); - } - - /** - * 批量删除 - * - * @param ids - * @return - */ - @AutoLog(value = "sap_subfactory-批量删除") - @ApiOperation(value="sap_subfactory-批量删除", notes="sap_subfactory-批量删除") - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:sap_subfactory:deleteBatch") - @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.sapSubfactoryService.removeByIds(Arrays.asList(ids.split(","))); - return Result.OK("批量删除成功!"); - } - - /** - * 通过id查询 - * - * @param id - * @return - */ - //@AutoLog(value = "sap_subfactory-通过id查询") - @ApiOperation(value="sap_subfactory-通过id查询", notes="sap_subfactory-通过id查询") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { - SapSubfactory sapSubfactory = sapSubfactoryService.getById(id); - if(sapSubfactory==null) { - return Result.error("未找到对应数据"); - } - return Result.OK(sapSubfactory); - } - - /** - * 导出excel - * - * @param request - * @param sapSubfactory - */ - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:sap_subfactory:exportXls") - @RequestMapping(value = "/exportXls") - public ModelAndView exportXls(HttpServletRequest request, SapSubfactory sapSubfactory) { - return super.exportXls(request, sapSubfactory, SapSubfactory.class, "sap_subfactory"); - } - - /** - * 通过excel导入数据 - * - * @param request - * @param response - * @return - */ - //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:sap_subfactory:importExcel") - @RequestMapping(value = "/importExcel", method = RequestMethod.POST) - public Result importExcel(HttpServletRequest request, HttpServletResponse response) { - return super.importExcel(request, response, SapSubfactory.class); - } - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostCount.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostCount.java new file mode 100644 index 0000000..60707fb --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostCount.java @@ -0,0 +1,85 @@ +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.Builder; +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_count + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +@Data +@TableName("app_scene_cost_count") +@Builder +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="app_scene_cost_count对象", description="app_scene_cost_count") +public class AppSceneCostCount implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @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; + /**stage*/ + @Excel(name = "stage", width = 15) + @ApiModelProperty(value = "stage") + private String stage; + /**标准成本计算流程id*/ + @Excel(name = "标准成本计算流程id", width = 15) + @ApiModelProperty(value = "标准成本计算流程id") + private Integer flowDefinitionId; + /**year*/ + @Excel(name = "year", width = 15) + @ApiModelProperty(value = "year") + private String year; + /**状态*/ + @Excel(name = "状态", width = 15) + @ApiModelProperty(value = "状态") + private Integer status; + /**模型版本*/ + @Excel(name = "模型版本", width = 15) + @ApiModelProperty(value = "模型版本") + private String costVersion; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private Integer createBy; + /**创建时间*/ + @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 Date updateTime; +} 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 new file mode 100644 index 0000000..a80a2fd --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostModel.java @@ -0,0 +1,75 @@ +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_model + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +@Data +@TableName("app_scene_cost_model") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@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) + @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") + 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") + @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 Date updateTime; +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java new file mode 100644 index 0000000..b431044 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/AppSceneCostResultValue.java @@ -0,0 +1,118 @@ +package com.zzsmart.qomo.kn.cost.manage.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Builder; +import lombok.Data; +import lombok.EqualsAndHashCode; +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_result_value + * @Author: jeecg-boot + * @Date: 2024-07-25 + * @Version: V1.0 + */ +@Data +@Builder +@TableName("app_scene_cost_result_value") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "app_scene_cost_result_value对象", description = "app_scene_cost_result_value") +public class AppSceneCostResultValue implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private Integer id; + /** + * 所属最上级物料号 + */ + @Excel(name = "所属最上级物料号", width = 15) + @ApiModelProperty(value = "所属最上级物料号") + private String belongTopMaterialNo; + /** + * 物料编号 + */ + @Excel(name = "物料编号", width = 15) + @ApiModelProperty(value = "物料编号") + private String marterialNo; + /** + * 父类物料编号 + */ + @Excel(name = "父类物料编号", width = 15) + @ApiModelProperty(value = "父类物料编号") + private String parentMarterialNo; + /** + * 数量 + */ + @Excel(name = "数量", width = 15) + @ApiModelProperty(value = "数量") + private Integer num; + /** + * 单位 + */ + @Excel(name = "单位", width = 15) + @ApiModelProperty(value = "单位") + private String unit; + /** + * 任务类型 + */ + @Excel(name = "任务类型", width = 15) + @ApiModelProperty(value = "任务类型") + private String taskType; + /** + * 任务代码 + */ + @Excel(name = "任务代码", width = 15) + @ApiModelProperty(value = "任务代码") + private String taskCode; + /** + * 流程id + */ + @Excel(name = "流程id", width = 15) + @ApiModelProperty(value = "流程id") + private String flowInstanceId; + /** + * 本阶成本 + */ + @Excel(name = "本阶成本", width = 15) + @ApiModelProperty(value = "本阶成本") + private String countValue; + /** + * 创建时间 + */ + @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 createBy; + /** + * 总计成本 + */ + @Excel(name = "总计成本", width = 15) + @ApiModelProperty(value = "总计成本") + private String totalValue; + /** + * 成本类别 + */ + @Excel(name = "成本类别", width = 15) + @ApiModelProperty(value = "成本类别") + private String costType; +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/BudgetPrice.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/BudgetPrice.java deleted file mode 100644 index 070635f..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/BudgetPrice.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -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: budget_price - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -@Data -@TableName("budget_price") -@Accessors(chain = true) -@EqualsAndHashCode(callSuper = false) -@ApiModel(value = "budget_price对象", description = "budget_price") -public class BudgetPrice implements Serializable { - private static final long serialVersionUID = 1L; - - /** - * 主键 - */ - @TableId(type = IdType.ASSIGN_ID) - @ApiModelProperty(value = "主键") - private Integer id; - /** - * 年份 - */ - @Excel(name = "年份", width = 15) - @ApiModelProperty(value = "年份") - private String year; - /** - * 物料编码 - */ - @Excel(name = "物料编码", width = 15) - @ApiModelProperty(value = "物料编码") - private String materialNumber; - /** - * 物料名称 - */ - @Excel(name = "物料名称", width = 15) - @ApiModelProperty(value = "物料名称") - private String materialName; - /** - * 项目编号 - */ - @Excel(name = "项目编号", width = 15) - @ApiModelProperty(value = "项目编号") - private String projectNumber; - /** - * 预算价格 - */ - @Excel(name = "预算价格", width = 15) - @ApiModelProperty(value = "预算价格") - private BigDecimal price; - /** - * dwerk - */ - @Excel(name = "dwerk", width = 15) - @ApiModelProperty(value = "dwerk") - private String dwerk; - /** - * posid - */ - @Excel(name = "posid", width = 15) - @ApiModelProperty(value = "posid") - private String posid; -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/C7525cost.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/C7525cost.java deleted file mode 100644 index 6b462c6..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/C7525cost.java +++ /dev/null @@ -1,54 +0,0 @@ -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.*; -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: c7525cost - * @Author: jeecg-boot - * @Date: 2024-06-06 - * @Version: V1.0 - */ -@Data -@TableName("c7525cost") -@Accessors(chain = true) -@EqualsAndHashCode(callSuper = false) -@ApiModel(value="c7525cost对象", description="c7525cost") -public class C7525cost implements Serializable { - private static final long serialVersionUID = 1L; - - /**年份*/ - @Excel(name = "年份", width = 15) - @ApiModelProperty(value = "年份") - private String year; - /**门控料号(物料id)*/ - @Excel(name = "门控料号(物料id)", width = 15) - @ApiModelProperty(value = "门控料号(物料id)") - private String materialNumber; - /**物料规格信息*/ - @Excel(name = "物料规格信息", width = 15) - @ApiModelProperty(value = "物料规格信息") - private String zzggxh; - /**价格*/ - @Excel(name = "价格", width = 15) - @ApiModelProperty(value = "价格") - @TableField(value = "price_7525") - private BigDecimal price7525; - /**id*/ - @TableId(type = IdType.ASSIGN_ID) - @ApiModelProperty(value = "id") - private Integer id; -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostCenter.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostCenter.java deleted file mode 100644 index b214b6d..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostCenter.java +++ /dev/null @@ -1,55 +0,0 @@ -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: cost_center - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -@Data -@TableName("cost_center") -@Accessors(chain = true) -@EqualsAndHashCode(callSuper = false) -@ApiModel(value="cost_center对象", description="cost_center") -public class CostCenter implements Serializable { - private static final long serialVersionUID = 1L; - - /**公司代码*/ - @Excel(name = "公司代码", width = 15) - @ApiModelProperty(value = "公司代码") - private String companyCode; - /**成本中心代码*/ - @Excel(name = "成本中心代码", width = 15) - @ApiModelProperty(value = "成本中心代码") - private String costCenterCode; - /**成本中心名称*/ - @Excel(name = "成本中心名称", width = 15) - @ApiModelProperty(value = "成本中心名称") - private String costCenterName; - /**成本类型*/ - @Excel(name = "成本类型", width = 15) - @ApiModelProperty(value = "成本类型") - private String costCategory; - /**状态*/ - @Excel(name = "状态", width = 15) - @ApiModelProperty(value = "状态") - private String status; -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostMaterialBom.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostMaterialBom.java index 9f4511b..4f0ef69 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostMaterialBom.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostMaterialBom.java @@ -4,14 +4,9 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; - import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; import lombok.experimental.Accessors; @@ -21,14 +16,13 @@ import lombok.experimental.Accessors; * 物料bom *

* - * @author - * @since 2024-06-19 + * @author + * @since 2024-06-21 */ @Getter @Setter @Accessors(chain = true) -@TableName("cost_material_bom") -@ApiModel(value = "cost_material_bom对象", description = "cost_material_bom") +@TableName("app_scene_cost_material_bom") public class CostMaterialBom implements Serializable { private static final long serialVersionUID = 1L; @@ -36,233 +30,198 @@ public class CostMaterialBom implements Serializable { /** * id */ - @ApiModelProperty(value = "id") @TableId(value = "id", type = IdType.AUTO) private String id; /** * 物料编码 */ - @ApiModelProperty(value = "物料编码") @TableField("material_code") private String materialCode; /** * 物料名称 */ - @ApiModelProperty(value = "物料名称") @TableField("material_name") private String materialName; /** * 父级物料编码 */ - @ApiModelProperty(value = "父级物料编码") @TableField("parent_material_code") private String parentMaterialCode; /** * 级别 */ - @ApiModelProperty(value = "级别") @TableField("level") private String level; /** * 排序 */ - @ApiModelProperty(value = "排序") @TableField("sort") private Integer sort; /** * 计量单位 */ - @ApiModelProperty(value = "计量单位") @TableField("unit") private String unit; /** * 数量 */ - @ApiModelProperty(value = "id") - @TableField("数量") + @TableField("number") private Integer number; /** * 人工工时(分钟) */ - @ApiModelProperty(value = "人工工时(分钟)") @TableField("labor_hours") private BigDecimal laborHours; /** * 设备工时 */ - @ApiModelProperty(value = "设备工时") @TableField("device_hours") private BigDecimal deviceHours; /** * 借用物料编码 */ - @ApiModelProperty(value = "借用物料编码") @TableField("borrow_material_code") private String borrowMaterialCode; /** * 参考物料编码 */ - @ApiModelProperty(value = "参考物料编码") @TableField("refer_material_code") private String referMaterialCode; /** * 采购类型 */ - - @ApiModelProperty(value = "采购类型") @TableField("purchase_type") private String purchaseType; /** * 特殊采购类型 */ - - @ApiModelProperty(value = "特殊采购类型") @TableField("special_purchase_type") private String specialPurchaseType; /** * 说明 */ - @ApiModelProperty(value = "说明") @TableField("explanation") private String explanation; /** * 单位数量 */ - @ApiModelProperty(value = "单位数量") @TableField("quantity") private BigDecimal quantity; /** * 重量(g) */ - @ApiModelProperty(value = "重量(g)") @TableField("weight") private String weight; /** * 材料/牌号 */ - @ApiModelProperty(value = "材料/牌号") @TableField("material_and_brand") private String materialAndBrand; /** * 表面处理,材料 */ - @ApiModelProperty(value = "表面处理,材料") @TableField("surface_material") private String surfaceMaterial; /** * 厚度(mm) */ - @ApiModelProperty(value = "厚度(mm)") @TableField("surface_thickness") private String surfaceThickness; /** * 表面积(mm²) */ - @ApiModelProperty(value = "表面积(mm²)") @TableField("surface_area") private String surfaceArea; /** * 长(mm) */ - @ApiModelProperty(value = "长(mm)") @TableField("length") private String length; /** * 宽(mm) */ - @ApiModelProperty(value = "宽(mm)") @TableField("width") private String width; /** * 高(mm) */ - @ApiModelProperty(value = "高(mm)") @TableField("height") private String height; /** * 图示/图档/文档 文件ID */ - @ApiModelProperty(value = "图示/图档/文档 文件ID") @TableField("figure_file_id") private Long figureFileId; /** - * 是否新模具(0否 1是) + * 是否新摸具(0否 1是) */ - @ApiModelProperty(value = "是否新模具(0否 1是)") @TableField("new_tooling") private Boolean newTooling; /** * 成型方式(枚举) */ - @ApiModelProperty(value = "成型方式(枚举)") @TableField("shaping_method") private String shapingMethod; /** * 作业内容 */ - @ApiModelProperty(value = "作业内容") @TableField("work_content") private String workContent; /** * 加工地点 */ - @ApiModelProperty(value = "加工地点") @TableField("process_location") private String processLocation; /** * 成本中心 */ - @ApiModelProperty(value = "成本中心") @TableField("cost_center") private String costCenter; /** * 单价(未税) */ - @ApiModelProperty(value = "单价(未税)") @TableField("unit_price") private BigDecimal unitPrice; /** * 总价(未税) */ - @ApiModelProperty(value = "总价(未税)") @TableField("total_price") private BigDecimal totalPrice; /** - * 模具费(未税) + * 摸具费(未税) */ - @ApiModelProperty(value = "模具费(未税)") @TableField("mould_price") private BigDecimal mouldPrice; @@ -293,7 +252,6 @@ public class CostMaterialBom implements Serializable { /** * 备注(特殊技术信息) */ - @ApiModelProperty(value = "备注(特殊技术信息)") @TableField("remark") private String remark; diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostMaterialProcessHours.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostMaterialProcessHours.java index e1e2cb4..f2bfabd 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostMaterialProcessHours.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostMaterialProcessHours.java @@ -25,7 +25,7 @@ import lombok.experimental.Accessors; @Getter @Setter @Accessors(chain = true) -@TableName("cost_material_process_hours") +@TableName("app_scene_cost_material_process_hours") public class CostMaterialProcessHours implements Serializable { private static final long serialVersionUID = 1L; diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostModel.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostModel.java new file mode 100644 index 0000000..51b57d9 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostModel.java @@ -0,0 +1,135 @@ +package com.zzsmart.qomo.kn.cost.manage.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.time.LocalDateTime; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +/** + *

+ * + *

+ * + * @author + * @since 2024-07-11 + */ +@Getter +@Setter +@Accessors(chain = true) +@TableName("app_scene_cost_model") +public class CostModel implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 模型名称 + */ + @ApiModelProperty(value = "模型名称") + @TableField("model_name") + private String modelName; + + /** + * 图号 + */ + @ApiModelProperty(value = "图号") + @TableField("drawing_no") + private Integer drawingNo; + + /** + * 物料号 + */ + @ApiModelProperty(value = "物料号") + @TableField("material_no") + private Integer materialNo; + + /** + * 物料类型 + */ + @ApiModelProperty(value = "物料类型") + @TableField("material_type") + private String materialType; + + /** + * 模型版本 + */ + @ApiModelProperty(value = "模型版本") + @TableField("model_version") + private String modelVersion; + + /** + * 状态 + */ + @ApiModelProperty(value = "状态") + @TableField("status") + private String status; + + /** + * 创建时间 + */ + @ApiModelProperty(value = "创建时间") + @TableField("create_time") + private LocalDateTime createTime; + + /** + * 创建人 + */ + @TableField("create_by") + private Integer createBy; + + /** + * 更新时间 + */ + @TableField("update_time") + private LocalDateTime updateTime; + + /** + * 更新人 + */ + @TableField("update_by") + private Integer updateBy; + + /** + * 模型配置信息 + */ + @TableField("cost_model_detail") + private String costModelDetail; + + + public static final String ID = "id"; + + public static final String MODEL_NAME = "model_name"; + + public static final String DRAWING_NO = "drawing_no"; + + public static final String MATERIAL_NO = "material_no"; + + public static final String MATERIAL_TYPE = "material_type"; + + public static final String MODEL_VERSION = "model_version"; + + public static final String STATUS = "status"; + + public static final String CREATE_TIME = "create_time"; + + public static final String CREATE_BY = "create_by"; + + public static final String UPDATE_TIME = "update_time"; + + public static final String UPDATE_BY = "update_by"; + + public static final String COST_MODEL_DETAIL = "cost_model_detail"; + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPartMissingInfo.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPartMissingInfo.java index 2b948da..dfeb6f2 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPartMissingInfo.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPartMissingInfo.java @@ -25,10 +25,10 @@ import lombok.experimental.Accessors; * @Version: V1.0 */ @Data -@TableName("cost_part_missing_info") +@TableName("app_scene_cost_part_missing_info") @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) -@ApiModel(value="cost_part_missing_info对象", description="cost_part_missing_info") +@ApiModel(value="app_scene_cost_part_missing_info对象", description="app_scene_cost_part_missing_info") public class CostPartMissingInfo implements Serializable { private static final long serialVersionUID = 1L; diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPurchasePrice.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPurchasePrice.java index 233b35e..07974d5 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPurchasePrice.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostPurchasePrice.java @@ -22,7 +22,7 @@ import lombok.experimental.Accessors; @Getter @Setter @Accessors(chain = true) -@TableName("cost_purchase_price") +@TableName("app_scene_cost_purchase_price") public class CostPurchasePrice implements Serializable { private static final long serialVersionUID = 1L; diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandard.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandard.java deleted file mode 100644 index 2a0094b..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandard.java +++ /dev/null @@ -1,132 +0,0 @@ -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: 标准成本 - * @Author: wangqiong - * @Date: 2024-06-13 - * @Version: V1.0 - */ -@Data -@TableName("cost_standard") -@Accessors(chain = true) -@EqualsAndHashCode(callSuper = false) -@ApiModel(value="cost_standard对象", description="cost_standard") -public class CostStandard implements Serializable { - private static final long serialVersionUID = 1L; - - /**id*/ - @TableId(type = IdType.ASSIGN_ID) - @ApiModelProperty(value = "id") - private String id; - /**物料号*/ - @Excel(name = "物料号", width = 15) - @ApiModelProperty(value = "物料号") - private String materialNumber; - - /**版本号ID*/ - @Excel(name = "版本号ID", width = 15) - @ApiModelProperty(value = "版本号ID") - private String versionNumberId; - - /**bom材料费*/ - @Excel(name = "bom材料费", width = 15) - @ApiModelProperty(value = "bom材料费") - private BigDecimal bomCost; - /**包装费*/ - @Excel(name = "包装费", width = 15) - @ApiModelProperty(value = "包装费") - private BigDecimal packingCost; - /**辅料费*/ - @Excel(name = "辅料费", width = 15) - @ApiModelProperty(value = "辅料费") - private BigDecimal auxiliaryCost; - /**人工费*/ - @Excel(name = "人工费", width = 15) - @ApiModelProperty(value = "人工费") - private BigDecimal laborCost; - /**机器折旧费*/ - @Excel(name = "机器折旧费", width = 15) - @ApiModelProperty(value = "机器折旧费") - private BigDecimal euipDepreciationCost; - /**机物料消耗费*/ - @Excel(name = "机物料消耗费", width = 15) - @ApiModelProperty(value = "机物料消耗费") - private BigDecimal equipConsumeCost; - /**水电费*/ - @Excel(name = "水电费", width = 15) - @ApiModelProperty(value = "水电费") - private BigDecimal hydroelectricityCost; - /**其他制造费*/ - @Excel(name = "其他制造费", width = 15) - @ApiModelProperty(value = "其他制造费") - private BigDecimal otherCost; - /**物流费*/ - @Excel(name = "物流费", width = 15) - @ApiModelProperty(value = "物流费") - private BigDecimal trailCost; - /**制造成本*/ - @Excel(name = "制造成本", width = 15) - @ApiModelProperty(value = "制造成本") - private BigDecimal manufactureCost; - /**工装费*/ - @Excel(name = "工装费", width = 15) - @ApiModelProperty(value = "工装费") - private BigDecimal toolingCost; - /**检具费*/ - @Excel(name = "检具费", width = 15) - @ApiModelProperty(value = "检具费") - private BigDecimal inspectionCost; - /**模具费*/ - @Excel(name = "模具费", width = 15) - @ApiModelProperty(value = "模具费") - private BigDecimal moldCost; - /**测试费*/ - @Excel(name = "测试费", width = 15) - @ApiModelProperty(value = "测试费") - private BigDecimal testCost; - /**总成本*/ - @Excel(name = "总成本", width = 15) - @ApiModelProperty(value = "总成本") - private BigDecimal totalCost; - /**创建人*/ - @Excel(name = "创建人", width = 15) - @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 createTime; - /**修改人*/ - @Excel(name = "修改人", width = 15) - @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; - /**备注*/ - @Excel(name = "备注", width = 15) - @ApiModelProperty(value = "备注") - private String remark; -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandardDetail.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandardDetail.java index 3177e78..7318f6f 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandardDetail.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandardDetail.java @@ -4,28 +4,28 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +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; import java.time.LocalDateTime; -import io.swagger.annotations.ApiModelProperty; -import lombok.Builder; -import lombok.Data; -import lombok.Getter; -import lombok.Setter; -import lombok.experimental.Accessors; - /** *

* 标准成本明细表 *

* - * @author + * @author * @since 2024-06-20 */ @Data @Accessors(chain = true) -@TableName("cost_standard_detail") +@TableName("app_scene_cost_standard_detail") +@EqualsAndHashCode public class CostStandardDetail implements Serializable { private static final long serialVersionUID = 1L; @@ -41,6 +41,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("material_number") @ApiModelProperty(value = "物料号,关联kn_new_sap_mara表matnr字段") + @Excel(name = "物料号") private String materialNumber; /** @@ -48,6 +49,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("material_name") @ApiModelProperty(value = "物料名称") + @Excel(name = "物料名称") private String materialName; /** @@ -55,6 +57,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("parent_material_number") @ApiModelProperty(value = "父类物料号") + @Excel(name = "父类物料号") private String parentMaterialNumber; /** @@ -69,6 +72,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("level") @ApiModelProperty(value = "层级") + @Excel(name = "层级") private Integer level; /** @@ -76,6 +80,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("figure_number") @ApiModelProperty(value = "图号") + @Excel(name = "图号") private String figureNumber; /** @@ -83,6 +88,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("dosage") @ApiModelProperty(value = "用量") + @Excel(name = "用量") private Double dosage; /** @@ -90,6 +96,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("unit") @ApiModelProperty(value = "单位") + @Excel(name = "单位") private String unit; /** @@ -97,6 +104,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("specification") @ApiModelProperty(value = "规格") + @Excel(name = "规格") private String specification; /** @@ -104,6 +112,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("bom_cost") @ApiModelProperty(value = "bom材料费") + @Excel(name = "bom材料费") private BigDecimal bomCost; /** @@ -111,6 +120,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("packing_cost") @ApiModelProperty(value = "包装费") + @Excel(name = "包装费") private BigDecimal packingCost; /** @@ -118,6 +128,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("auxiliary_cost") @ApiModelProperty(value = "本阶辅料费") + @Excel(name = "本阶辅料费") private BigDecimal auxiliaryCost; /** @@ -125,6 +136,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("labor_cost") @ApiModelProperty(value = "本阶人工费") + @Excel(name = "本阶人工费") private BigDecimal laborCost; /** @@ -132,6 +144,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("euip_depreciation_cost") @ApiModelProperty(value = "机器折旧费") + @Excel(name = "机器折旧费") private BigDecimal euipDepreciationCost; /** @@ -139,6 +152,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("equip_consume_cost") @ApiModelProperty(value = "机物料消耗费") + @Excel(name = "机物料消耗费") private BigDecimal equipConsumeCost; /** @@ -146,6 +160,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("hydroelectricity_cost") @ApiModelProperty(value = "水电费") + @Excel(name = "水电费") private BigDecimal hydroelectricityCost; /** @@ -153,6 +168,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("other_cost") @ApiModelProperty(value = "其他制造费") + @Excel(name = "其他制造费") private BigDecimal otherCost; /** @@ -160,6 +176,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("trail_cost") @ApiModelProperty(value = "物流费") + @Excel(name = "物流费") private BigDecimal trailCost; /** @@ -167,6 +184,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("manufacture_cost") @ApiModelProperty(value = "制造成本") + @Excel(name = "制造成本") private BigDecimal manufactureCost; /** @@ -174,6 +192,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("total_labor_cost") @ApiModelProperty(value = "累计人工费") + @Excel(name = "累计人工费") private BigDecimal totalLaborCost; /** @@ -181,6 +200,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("total_equip_consume_cost") @ApiModelProperty(value = "累计机器消耗费") + @Excel(name = "累计机器消耗费") private BigDecimal totalEquipConsumeCost; /** @@ -188,6 +208,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("total_euip_depreciation_cost") @ApiModelProperty(value = "累计机器折旧费") + @Excel(name = "累计机器折旧费") private BigDecimal totalEuipDepreciationCost; /** @@ -195,6 +216,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("total_hydroelectricity_cost") @ApiModelProperty(value = "累计水电费") + @Excel(name = "累计水电费") private BigDecimal totalHydroelectricityCost; /** @@ -202,6 +224,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("total_other_cost") @ApiModelProperty(value = "累计其它费用") + @Excel(name = "累计其它费用") private BigDecimal totalOtherCost; /** @@ -244,6 +267,7 @@ public class CostStandardDetail implements Serializable { */ @TableField("sort") @ApiModelProperty(value = "序号") + @Excel(name = "序号") private Integer sort; } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandardVersion.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandardVersion.java index 8a174a6..e65e5ef 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandardVersion.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/CostStandardVersion.java @@ -1,80 +1,103 @@ 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.Builder; +import lombok.Data; import lombok.EqualsAndHashCode; 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: 标准成本-版本号 * @Author: wangqiong - * @Date: 2024-06-13 + * @Date: 2024-06-13 * @Version: V1.0 */ @Data -@TableName("cost_standard_version") +@TableName("app_scene_cost_standard_version") +@Builder @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) -@ApiModel(value="cost_standard_version对象", description="cost_standard_version") +@ApiModel(value = "app_scene_cost_standard_version对象", description = "app_scene_cost_standard_version") public class CostStandardVersion implements Serializable { private static final long serialVersionUID = 1L; - /**id*/ - @TableId(type = IdType.ASSIGN_ID) + /** + * id + */ + @TableId(type = IdType.ASSIGN_ID) @ApiModelProperty(value = "id") private String id; - /**图号*/ + /** + * 图号 + */ @Excel(name = "图号", width = 15) @ApiModelProperty(value = "图号") private String figureNumber; - /**阶段,A-初始,B-首批,C-量产*/ - @Excel(name = "阶段", width = 15) + /** + * 阶段,A-初始,B-首批,C-量产 + */ + @Excel(name = "阶段", width = 15) @ApiModelProperty(value = "阶段") private String stage; - /**物料号*/ - @Excel(name = "物料号", width = 15) + /** + * 物料号 + */ + @Excel(name = "物料号", width = 15) @ApiModelProperty(value = "物料号") private String materialNumber; - /**版本号*/ + /** + * 版本号 + */ @ApiModelProperty(value = "版本号") private String versionNumber; - /**版本状态*/ + /** + * 版本状态 + */ @ApiModelProperty(value = "版本状态") private String versionStatus; - /**创建人*/ + /** + * 创建人 + */ @ApiModelProperty(value = "创建人") private String createBy; - /**创建时间*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="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; - /**修改人*/ + /** + * 修改人 + */ @ApiModelProperty(value = "修改人") private String updateBy; - /**修改时间*/ - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern="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 String remark; - /**年份*/ + /** + * 年份 + */ @ApiModelProperty(value = "年份") private String versionYear; } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/HourRate.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/HourRate.java index fe8fba1..3da771c 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/HourRate.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/HourRate.java @@ -23,7 +23,7 @@ import lombok.experimental.Accessors; * @Version: V1.0 */ @Data -@TableName("cost_hour_rate") +@TableName("app_scene_cost_hour_rate") @Accessors(chain = true) @EqualsAndHashCode(callSuper = false) @ApiModel(value="hour_rate对象", description="hour_rate") diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/LatestPurchasePrice.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/LatestPurchasePrice.java deleted file mode 100644 index 98b73ae..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/LatestPurchasePrice.java +++ /dev/null @@ -1,107 +0,0 @@ -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: latest_purchase_price - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -@Data -@TableName("latest_purchase_price") -@Accessors(chain = true) -@EqualsAndHashCode(callSuper = false) -@ApiModel(value="latest_purchase_price对象", description="latest_purchase_price") -public class LatestPurchasePrice implements Serializable { - private static final long serialVersionUID = 1L; - - /**门控料号(物料id)*/ - @Excel(name = "门控料号(物料id)", width = 15) - @ApiModelProperty(value = "门控料号(物料id)") - private String materialNumber; - /**产品名称*/ - @Excel(name = "产品名称", width = 15) - @ApiModelProperty(value = "产品名称") - private String name; - /**规格*/ - @Excel(name = "规格", width = 15) - @ApiModelProperty(value = "规格") - private String norms; - /**单位*/ - @Excel(name = "单位", width = 15) - @ApiModelProperty(value = "单位") - private String unit; - /**latestInvoiceNo*/ - @Excel(name = "latestInvoiceNo", width = 15) - @ApiModelProperty(value = "latestInvoiceNo") - private String latestInvoiceNo; - /**估算日期*/ - @Excel(name = "估算日期", width = 15, format = "yyyy-MM-dd") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern="yyyy-MM-dd") - @ApiModelProperty(value = "估算日期") - private Date latestInvoiceDate; - /**latestInvoiceSupplier*/ - @Excel(name = "latestInvoiceSupplier", width = 15) - @ApiModelProperty(value = "latestInvoiceSupplier") - private String latestInvoiceSupplier; - /**latestInvoicePrice*/ - @Excel(name = "latestInvoicePrice", width = 15) - @ApiModelProperty(value = "latestInvoicePrice") - private BigDecimal latestInvoicePrice; - /**不含税价格*/ - @Excel(name = "不含税价格", width = 15) - @ApiModelProperty(value = "不含税价格") - private BigDecimal unitPriceWithoutTax; - /**interExamCost*/ - @Excel(name = "interExamCost", width = 15) - @ApiModelProperty(value = "interExamCost") - private BigDecimal interExamCost; - /**工厂代号(工厂id)*/ - @Excel(name = "工厂代号(工厂id)", width = 15) - @ApiModelProperty(value = "工厂代号(工厂id)") - private String factory; - /**维护人*/ - @Excel(name = "维护人", width = 15) - @ApiModelProperty(value = "维护人") - private String guardian; - /**维护时间*/ - @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 maintenanceTime; - /**isadd*/ - @Excel(name = "isadd", width = 15) - @ApiModelProperty(value = "isadd") - private Integer isadd; - /**采购类型*/ - @Excel(name = "采购类型", width = 15) - @ApiModelProperty(value = "采购类型") - private String purchaseType; - /**是否启用*/ - @Excel(name = "是否启用", width = 15) - @ApiModelProperty(value = "是否启用") - private Integer isinvalid; - /**id*/ - @TableId(type = IdType.ASSIGN_ID) - @ApiModelProperty(value = "id") - private String id; -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/ProduceBatch.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/ProduceBatch.java deleted file mode 100644 index cfe96d4..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/ProduceBatch.java +++ /dev/null @@ -1,65 +0,0 @@ -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: produce_batch - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -@Data -@TableName("produce_batch") -@Accessors(chain = true) -@EqualsAndHashCode(callSuper = false) -@ApiModel(value="produce_batch对象", description="produce_batch") -public class ProduceBatch implements Serializable { - private static final long serialVersionUID = 1L; - - /**门控料号(物料id)*/ - @Excel(name = "门控料号(物料id)", width = 15) - @ApiModelProperty(value = "门控料号(物料id)") - private String materialNumber; - /**工厂代号(工厂id)*/ - @Excel(name = "工厂代号(工厂id)", width = 15) - @ApiModelProperty(value = "工厂代号(工厂id)") - private String factory; - /**生产批量*/ - @Excel(name = "生产批量", width = 15) - @ApiModelProperty(value = "生产批量") - private BigDecimal batch; - /**维护人(用户id)*/ - @Excel(name = "维护人(用户id)", width = 15) - @ApiModelProperty(value = "维护人(用户id)") - private String guardian; - /**维护时间*/ - @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 maintenanceTime; - /**aufnr*/ -// @Excel(name = "aufnr", width = 15) - @ApiModelProperty(value = "aufnr") - private String aufnr; - /**主键*/ - @TableId(type = IdType.ASSIGN_ID) - @ApiModelProperty(value = "主键") - private String id; -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/SapSubfactory.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/SapSubfactory.java deleted file mode 100644 index 79711ba..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/entity/SapSubfactory.java +++ /dev/null @@ -1,47 +0,0 @@ -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: sap_subfactory - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -@Data -@TableName("sap_subfactory") -@Accessors(chain = true) -@EqualsAndHashCode(callSuper = false) -@ApiModel(value="sap_subfactory对象", description="sap_subfactory") -public class SapSubfactory implements Serializable { - private static final long serialVersionUID = 1L; - - /**主键*/ - @TableId(type = IdType.ASSIGN_ID) - @ApiModelProperty(value = "主键") - private Integer id; - /**公司代码*/ - @Excel(name = "公司代码", width = 15) - @ApiModelProperty(value = "公司代码") - private String companyCode; - /**工厂代码*/ - @Excel(name = "工厂代码", width = 15) - @ApiModelProperty(value = "工厂代码") - private String factory; -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/FeeTypeEnum.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/FeeTypeEnum.java new file mode 100644 index 0000000..2d22189 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/FeeTypeEnum.java @@ -0,0 +1,61 @@ +package com.zzsmart.qomo.kn.cost.manage.enums; + +/** + * @Classname StandardStageEnum + * @Description 阶段枚举 + * @Version 1.0.0 + * @Date 2024/6/18 9:51 + * @Created wangqiong + */ +public enum FeeTypeEnum { + + LaborCost("LaborCost", "人工成本"), + MaterialCost("MaterialCost", "物料成本"), + EquipmentFee("EquipmentFee", "设备费"), SupplyMaterialFee("SupplyMaterialFee", "辅料费"), DriverFee("DriverFee", "水电费"), OtherFee("OtherFee", "其他费用"), LogisticsFee("LogisticsFee", "物流费"); + + private final String code; + private final String text; + + FeeTypeEnum(String code, String text) { + this.code = code; + this.text = text; + } + + public String getCode() { + return code; + } + + public String getText() { + return text; + } + + /** + * 根据code获取text + * + * @param codeNo + * @return + */ + public static String getTextByCode(String codeNo) { + for (FeeTypeEnum value : FeeTypeEnum.values()) { + if (value.getCode().equals(codeNo)) { + return value.getText(); + } + } + return codeNo.toString(); + } + + /** + * 根据text获取code + * + * @param textStr + * @return + */ + public static String getCodeByText(String textStr) { + for (FeeTypeEnum value : FeeTypeEnum.values()) { + if (value.getText().equals(textStr)) { + return value.getText(); + } + } + return textStr; + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/StandardStageEnum.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/StandardStageEnum.java index 1efa289..59f5db1 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/StandardStageEnum.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/enums/StandardStageEnum.java @@ -8,39 +8,33 @@ package com.zzsmart.qomo.kn.cost.manage.enums; * @Created wangqiong */ public enum StandardStageEnum { - INIT("A", "初始"), - FIRST_BATCH("B", "首批"), - MASS_PRODUCTION("C", "量产"), - - - ; + INIT("A", "初始"), FIRST_BATCH("B", "首批"), MASS_PRODUCTION("C", "量产"); private final String code; private final String text; - StandardStageEnum(String code, String text) - { + StandardStageEnum(String code, String text) { this.code = code; this.text = text; } - public String getCode() - { + public String getCode() { return code; } - public String getText() - { + public String getText() { return text; } + /** * 根据code获取text + * * @param codeNo * @return */ - public static String getTextByCode(String codeNo){ + public static String getTextByCode(String codeNo) { for (StandardStageEnum value : StandardStageEnum.values()) { - if (value.getCode().equals(codeNo)){ + if (value.getCode().equals(codeNo)) { return value.getText(); } } @@ -49,12 +43,13 @@ public enum StandardStageEnum { /** * 根据text获取code + * * @param textStr * @return */ - public static String getCodeByText(String textStr){ + public static String getCodeByText(String textStr) { for (StandardStageEnum value : StandardStageEnum.values()) { - if (value.getText().equals(textStr)){ + if (value.getText().equals(textStr)) { return value.getText(); } } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostCountMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostCountMapper.java new file mode 100644 index 0000000..ec22d28 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostCountMapper.java @@ -0,0 +1,14 @@ +package com.zzsmart.qomo.kn.cost.manage.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; + +/** + * @Description: app_scene_cost_count + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +public interface AppSceneCostCountMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostModelMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostModelMapper.java new file mode 100644 index 0000000..b782f12 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostModelMapper.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.AppSceneCostModel; + +/** + * @Description: app_scene_cost_model + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +public interface AppSceneCostModelMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostResultValueMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostResultValueMapper.java new file mode 100644 index 0000000..70abdc8 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/AppSceneCostResultValueMapper.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.AppSceneCostResultValue; + +/** + * @Description: app_scene_cost_result_value + * @Author: jeecg-boot + * @Date: 2024-07-23 + * @Version: V1.0 + */ +public interface AppSceneCostResultValueMapper extends BaseMapper { + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/BudgetPriceMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/BudgetPriceMapper.java deleted file mode 100644 index 99bd2bc..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/BudgetPriceMapper.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.BudgetPrice; - -/** - * @Description: budget_price - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -public interface BudgetPriceMapper extends BaseMapper { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/C7525costMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/C7525costMapper.java deleted file mode 100644 index 57a4091..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/C7525costMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.mapper; - -import java.util.List; - -import com.zzsmart.qomo.kn.cost.manage.entity.C7525cost; -import org.apache.ibatis.annotations.Param; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - * @Description: c7525cost - * @Author: jeecg-boot - * @Date: 2024-06-06 - * @Version: V1.0 - */ -public interface C7525costMapper extends BaseMapper { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostCenterMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostCenterMapper.java deleted file mode 100644 index 796d4cf..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostCenterMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.mapper; - -import java.util.List; - -import org.apache.ibatis.annotations.Param; -import com.zzsmart.qomo.kn.cost.manage.entity.CostCenter; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - * @Description: cost_center - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -public interface CostCenterMapper extends BaseMapper { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostMaterialBomMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostMaterialBomMapper.java index 081e812..c5fdff5 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostMaterialBomMapper.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostMaterialBomMapper.java @@ -1,18 +1,37 @@ package com.zzsmart.qomo.kn.cost.manage.mapper; -import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.sql.Blob; +import java.util.List; /** *

* 物料bom Mapper 接口 *

* - * @author - * @since 2024-06-19 + * @author + * @since 2024-06-21 */ @Mapper public interface CostMaterialBomMapper 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/CostStandardMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostStandardMapper.java deleted file mode 100644 index c3ab83e..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/CostStandardMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.mapper; - -import java.util.List; - -import com.baomidou.mybatisplus.core.conditions.Wrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.core.toolkit.Constants; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandard; -import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardVO; -import org.apache.ibatis.annotations.Param; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - * @Description: 标准成本 - * @Author: wangqiong - * @Date: 2024-06-13 - * @Version: V1.0 - */ -public interface CostStandardMapper extends BaseMapper { - - IPage pageList(@Param("page")Page page , @Param(Constants.WRAPPER) Wrapper wrapper); -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/LatestPurchasePriceMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/LatestPurchasePriceMapper.java deleted file mode 100644 index 4f40f46..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/LatestPurchasePriceMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.mapper; - -import java.util.List; - -import com.zzsmart.qomo.kn.cost.manage.entity.LatestPurchasePrice; -import org.apache.ibatis.annotations.Param; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - * @Description: latest_purchase_price - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -public interface LatestPurchasePriceMapper extends BaseMapper { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/ProduceBatchMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/ProduceBatchMapper.java deleted file mode 100644 index 9f51be5..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/ProduceBatchMapper.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.mapper; - -import java.util.List; - -import com.zzsmart.qomo.kn.cost.manage.entity.ProduceBatch; -import org.apache.ibatis.annotations.Param; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - * @Description: produce_batch - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -public interface ProduceBatchMapper extends BaseMapper { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/SapSubfactoryMapper.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/SapSubfactoryMapper.java deleted file mode 100644 index dd6af48..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/SapSubfactoryMapper.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.mapper; - -import java.util.List; - -import org.apache.ibatis.annotations.Param; -import com.zzsmart.qomo.kn.cost.manage.entity.SapSubfactory; -import com.baomidou.mybatisplus.core.mapper.BaseMapper; - -/** - * @Description: sap_subfactory - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -public interface SapSubfactoryMapper extends BaseMapper { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/ProduceBatchMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostCountMapper.xml similarity index 65% rename from qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/ProduceBatchMapper.xml rename to qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostCountMapper.xml index 1ae92c2..a286884 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/ProduceBatchMapper.xml +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostCountMapper.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/CostCenterMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostModelMapper.xml similarity index 65% rename from qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostCenterMapper.xml rename to qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostModelMapper.xml index 107fbef..2948e3f 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostCenterMapper.xml +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostModelMapper.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/LatestPurchasePriceMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostResultValueMapper.xml similarity index 63% rename from qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/LatestPurchasePriceMapper.xml rename to qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostResultValueMapper.xml index 19909f4..c15291c 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/LatestPurchasePriceMapper.xml +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/AppSceneCostResultValueMapper.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/BudgetPriceMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/BudgetPriceMapper.xml deleted file mode 100644 index aeeaa99..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/BudgetPriceMapper.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/C7525costMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/C7525costMapper.xml deleted file mode 100644 index ea32c53..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/C7525costMapper.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/CostStandardDetailMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostStandardDetailMapper.xml index 424a63d..cc5c7cf 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostStandardDetailMapper.xml +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostStandardDetailMapper.xml @@ -40,8 +40,8 @@ select c1.*, c2.version_number, c2.version_status, c2.stage,c2.version_year from - cost_standard_detail c1 - left join cost_standard_version c2 on c1.version_number_id = c2.id + app_scene_cost_standard_detail c1 + left join app_scene_cost_standard_version c2 on c1.version_number_id = c2.id ${ew.customSqlSegment} ORDER BY c1.create_time desc diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostStandardMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostStandardMapper.xml deleted file mode 100644 index 0baa717..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/CostStandardMapper.xml +++ /dev/null @@ -1,42 +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/SapSubfactoryMapper.xml b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/SapSubfactoryMapper.xml deleted file mode 100644 index 3588c13..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml/SapSubfactoryMapper.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/plugin/StandardCostService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java new file mode 100644 index 0000000..d09caca --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/StandardCostService.java @@ -0,0 +1,534 @@ +package com.zzsmart.qomo.kn.cost.manage.plugin; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.zzsmart.qomo.kn.cost.manage.entity.*; +import com.zzsmart.qomo.kn.cost.manage.enums.FeeTypeEnum; +import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialBomMapper; +import com.zzsmart.qomo.kn.cost.manage.service.*; +import com.zzsmart.qomo.kn.cost.manage.vo.FlowTaskInfoVO; +import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.PostConstruct; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Service +@Slf4j +public class StandardCostService { + /** + * 物料BOM信息 + */ + @Autowired + CostMaterialBomMapper costMaterialBomMapper; + @Autowired + CostMaterialBomService costMaterialBomService; + + /** + * 小时费率 + */ + @Autowired + IHourRateService iHourRateService; + /** + * 采购单价 + */ + @Autowired + CostPurchasePriceService costPurchasePriceService; + /** + * 工序 + */ + @Autowired + CostMaterialProcessHoursService costMaterialProcessHoursService; + /** + * 标准成本计算结果 + */ + @Autowired + IAppSceneCostResultValueService iAppSceneCostResultValueService; + public static StandardCostService standardCostService; + @Autowired + IAppSceneCostCountService appSceneCostCountService; + + + @PostConstruct + public void init() { + standardCostService = this; + standardCostService.costMaterialBomMapper = this.costMaterialBomMapper; + standardCostService.appSceneCostCountService = this.appSceneCostCountService; + standardCostService.costMaterialBomService = this.costMaterialBomService; + standardCostService.costPurchasePriceService = this.costPurchasePriceService; + standardCostService.iHourRateService = this.iHourRateService; + standardCostService.costMaterialProcessHoursService = this.costMaterialProcessHoursService; + standardCostService.iAppSceneCostResultValueService = this.iAppSceneCostResultValueService; + } + + /** + * 更新成本计算模型任务状态 + */ + public static void updateCostCountTaskStatus(Boolean isSuccess, Integer costCountTaskId) { + log.info("更新成本计算模型任务状态"); + standardCostService.appSceneCostCountService.updateById(AppSceneCostCount.builder().id(costCountTaskId).status(isSuccess != null && isSuccess ? 1 : 0).build()); + } + + /** + * 1.物料编号输入任务 + */ + public static void materialInputTask(TaskExecutionContext parameters) { + try { + //获取任务流程相关信息 + FlowTaskInfoVO flowTaskInfoVO = analysisFlowTaskInfo(parameters); + //获取最上层的物料号 + String topMaterialCode = flowTaskInfoVO.getTopMaterialCode(); + //获取任务类型 + String taskType = parameters.getTaskType(); + //获取任务代码 + String taskCode = flowTaskInfoVO.getTaskCode(); + //获取流程id + String flowInstanceId = flowTaskInfoVO.getFlowInstanceId(); + //1.查询出所有满足物料编号的物料(BOM物料) + String sql = flowTaskInfoVO.getSqlString(); + log.info("传递过来的SQL语句:" + sql); + 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++) { + CostMaterialBom 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); + } + } + + /** + * 获取任务流程相关信息 + * + * @param parameters + * @return + */ + private static FlowTaskInfoVO analysisFlowTaskInfo(TaskExecutionContext parameters) { + FlowTaskInfoVO flowTaskInfoVO = new FlowTaskInfoVO(); + if (parameters != null) { + String s = parameters.toString(); + String[] split = s.split(","); + for (int i = 0; i < split.length; i++) { + String s1 = split[i]; + if (s1.contains("taskType")) { + String[] split1 = s1.split("="); + if (split1[1].contains("\"")) { + split1[1] = split1[1].replaceAll("^\"|\"$", ""); // 去除首尾引号 + flowTaskInfoVO.setTaskType(split1[1]); + } else { + flowTaskInfoVO.setTaskType(split1[1]); + } + } else if (s1.contains("taskCode")) { + String[] split1 = s1.split(":"); + if (split1[1].contains("\"")) { + split1[1] = split1[1].replaceAll("^\"|\"$", ""); // 去除首尾引号 + flowTaskInfoVO.setTaskCode(split1[1]); + } else { + flowTaskInfoVO.setTaskCode(split1[1]); + } + } else if (s1.contains("flowInstanceId")) { + String[] split1 = s1.split("="); + if (split1[1].contains("\"")) { + split1[1] = split1[1].replaceAll("^\"|\"$", ""); // 去除首尾引号 + flowTaskInfoVO.setFlowInstanceId(split1[1]); + } else { + flowTaskInfoVO.setFlowInstanceId(split1[1]); + } + } else if (s1.contains("sqlString")) { + String[] split1 = s1.split(":"); + if (split1[1].contains("\"")) { + split1[1] = split1[1].replaceAll("^\"|\"$", ""); // 去除首尾引号 + flowTaskInfoVO.setSqlString(split1[1]); + } else { + flowTaskInfoVO.setSqlString(split1[1]); + } + } else if (s.contains("feeType") && s1.contains("feeType")) { + String[] split1 = s1.split(":"); + if (split1[1].contains("\"")) { + split1[1] = split1[1].replaceAll("^\"|\"$", ""); // 去除首尾引号 + flowTaskInfoVO.setFeeType(split1[1]); + } else { + flowTaskInfoVO.setFeeType(split1[1]); + } + } + } + } + //通过任务流程id查询流程定义信息(qomo_flow_definition) + flowTaskInfoVO = queryFlowDefinitionByFlowInstanceId(flowTaskInfoVO); + return flowTaskInfoVO; + } + + /** + * @param flowTaskInfoVO + */ + 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); + if (blob != null) { + if (blob != null && blob.contains("topMaterialCode")) { + JSONObject jsonObject1 = JSON.parseObject(blob); + String topMaterialCode = jsonObject1.getString("topMaterialCode"); + flowTaskInfoVO.setTopMaterialCode(topMaterialCode); + } + } + return flowTaskInfoVO; + } + + /** + * 2. 物料成本任务 + */ + public static void materialCostTask(TaskExecutionContext parameters) { + try { + //获取任务流程相关信息 + FlowTaskInfoVO flowTaskInfoVO = analysisFlowTaskInfo(parameters); + //获取最上层的物料号 + String topMaterialCode = flowTaskInfoVO.getTopMaterialCode(); + //获取任务类型 + String taskType = parameters.getTaskType(); + //获取任务代码 + String taskCode = flowTaskInfoVO.getTaskCode(); + //获取流程id + 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).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").build(); + standardCostService.iAppSceneCostResultValueService.save(resultValue); + } + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * 3.人工成本任务 + */ + public static void laborCostTask(TaskExecutionContext parameters) { + try { + //获取任务流程相关信息 + FlowTaskInfoVO flowTaskInfoVO = analysisFlowTaskInfo(parameters); + //获取最上层的物料号 + String topMaterialCode = flowTaskInfoVO.getTopMaterialCode(); + //获取任务类型 + String taskType = parameters.getTaskType(); + //获取任务代码 + String taskCode = flowTaskInfoVO.getTaskCode(); + //获取流程id + String flowInstanceId = flowTaskInfoVO.getFlowInstanceId(); + //成本类型 + String feeType = FeeTypeEnum.LaborCost.getCode(); + String sql1 = flowTaskInfoVO.getSqlString(); + 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) { + HourRate rate = JSON.toJavaObject(jsonObject, HourRate.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"); + List costMaterialProcessHours = processHoursMap.get(marterialNo); + if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { + for (int j = 0; j < costMaterialProcessHours.size(); j++) { + CostMaterialProcessHours processHours = costMaterialProcessHours.get(j); + BigDecimal laborHours = processHours.getLaborHours(); + //计算总人工成本 + totalCost = totalCost.add(laborHours.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).build(); + standardCostService.iAppSceneCostResultValueService.save(resultValue); + } + } + } catch (Exception e) { + throw new RuntimeException(e); + } + + } + + /** + * 4.制造费用成本任务 + */ + public static void manufacturingCostTask(TaskExecutionContext parameters) { + try { + //获取任务流程相关信息 + FlowTaskInfoVO flowTaskInfoVO = analysisFlowTaskInfo(parameters); + //获取最上层的物料号 + String topMaterialCode = flowTaskInfoVO.getTopMaterialCode(); + //获取任务类型 + String taskType = parameters.getTaskType(); + //获取任务代码 + String taskCode = flowTaskInfoVO.getTaskCode(); + //获取流程id + String flowInstanceId = flowTaskInfoVO.getFlowInstanceId(); + /** + * 费用类别 + */ + String feeType = flowTaskInfoVO.getFeeType(); + /** + * 小时费率 + */ + String sql1 = flowTaskInfoVO.getSqlString(); + 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) { + HourRate rate = JSON.toJavaObject(jsonObject, HourRate.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"); + List costMaterialProcessHours = processHoursMap.get(marterialNo); + if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { + for (int j = 0; j < costMaterialProcessHours.size(); j++) { + CostMaterialProcessHours processHours = costMaterialProcessHours.get(j); + BigDecimal laborHours = processHours.getDeviceHours(); + //计算机器成本 + totalCost = totalCost.add(laborHours.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).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"); + List costMaterialProcessHours = processHoursMap.get(marterialNo); + if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { + for (int j = 0; j < costMaterialProcessHours.size(); j++) { + CostMaterialProcessHours processHours = costMaterialProcessHours.get(j); + //TODO 辅料工时来源 + BigDecimal laborHours = processHours.getLaborHours(); + //机物料消耗 + totalCost = totalCost.add(laborHours.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).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"); + List costMaterialProcessHours = processHoursMap.get(marterialNo); + if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { + for (int j = 0; j < costMaterialProcessHours.size(); j++) { + CostMaterialProcessHours processHours = costMaterialProcessHours.get(j); + //TODO 燃动力工时来源 + BigDecimal laborHours = processHours.getLaborHours(); + //机物料消耗 + totalCost = totalCost.add(laborHours.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).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"); + List costMaterialProcessHours = processHoursMap.get(marterialNo); + if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) { + for (int j = 0; j < costMaterialProcessHours.size(); j++) { + CostMaterialProcessHours processHours = costMaterialProcessHours.get(j); + //TODO 其他工时来源 + BigDecimal laborHours = processHours.getLaborHours(); + //机物料消耗 + totalCost = totalCost.add(laborHours.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).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); + } + + } + + /** + * 5.标准成本计算任务 + */ + public static void standardCostTask(TaskExecutionContext parameters) { + //获取任务流程相关信息 + FlowTaskInfoVO flowTaskInfoVO = analysisFlowTaskInfo(parameters); + //获取最上层的物料号 + String topMaterialCode = flowTaskInfoVO.getTopMaterialCode(); + //获取任务类型 + String taskType = parameters.getTaskType(); + //获取任务代码 + String taskCode = flowTaskInfoVO.getTaskCode(); + //获取流程id + String flowInstanceId = flowTaskInfoVO.getFlowInstanceId(); + //1.查询出物料编号对应的下所有的BOM信息 + List list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, null, flowInstanceId); + //2.计算出所有的单个物料的本阶的标准成本(标准成本=物料成本+人工成本+制造费用) + //按照物料编号进行分组 + Map> materialNoMap = list.stream().collect(Collectors.groupingBy(AppSceneCostResultValue::getMarterialNo)); + for (String key : materialNoMap.keySet()) { + List appSceneCostResultValues = materialNoMap.get(key); + //本阶成本 + BigDecimal currentCost = new BigDecimal("0.0"); + for (int j = 0; j < appSceneCostResultValues.size(); j++) { + AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValues.get(j); + String countValue = appSceneCostResultValue.getCountValue(); + if (countValue != null) { + currentCost = currentCost.add(new BigDecimal(countValue)); + } + } + AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(key).parentMarterialNo(appSceneCostResultValues.get(0).getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(currentCost.toString()).build(); + standardCostService.iAppSceneCostResultValueService.save(resultValue); + } + //3.计算出所有的单个物料的累计标准成本 + List standardCostList = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, taskType, flowInstanceId); + //TODO 优化累计成本的计算 + totalCountCost(standardCostList, topMaterialCode, taskType, taskCode, flowInstanceId); + } + + /** + * 循环算出各个物料的累计成本 + * + * @param standardCostList + * @param topMaterialCode + * @param taskType + * @param taskCode + * @param flowInstanceId + */ + private static void totalCountCost(List standardCostList, String topMaterialCode, String taskType, String taskCode, String flowInstanceId) { + Map> parentMaterialNoMap = standardCostList.stream().filter(appSceneCostResultValue -> appSceneCostResultValue.getParentMarterialNo() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getParentMarterialNo)); + for (int i = 0; i < standardCostList.size(); i++) { + AppSceneCostResultValue oldAppSceneCostResultValue = standardCostList.get(i); + BigDecimal totalCost = new BigDecimal(oldAppSceneCostResultValue.getCountValue()); + totalCost = loopCount(oldAppSceneCostResultValue, parentMaterialNoMap, topMaterialCode, taskType, taskCode, flowInstanceId, totalCost); + oldAppSceneCostResultValue.setTotalValue(totalCost.toString()); + standardCostService.iAppSceneCostResultValueService.updateById(oldAppSceneCostResultValue); + //TODO 更新结果集到标准成本单行查询中去 + } + } + + /** + * //循环算出各个物料的累计成本 + * 递归计算出累计成本 + * + * @param appSceneCostResultValue + * @param parentMaterialNoMap + * @param topMaterialCode + * @param taskType + * @param taskCode + * @param flowInstanceId + */ + private static BigDecimal loopCount(AppSceneCostResultValue appSceneCostResultValue, Map> parentMaterialNoMap, String topMaterialCode, String taskType, String taskCode, String flowInstanceId, BigDecimal totalCost) { + String marterialNo = appSceneCostResultValue.getMarterialNo(); + if (parentMaterialNoMap.containsKey(marterialNo)) { + List appSceneCostResultValues = parentMaterialNoMap.get(marterialNo); + for (int j = 0; j < appSceneCostResultValues.size(); j++) { + AppSceneCostResultValue appSceneCostResultValue1 = appSceneCostResultValues.get(j); + String countValue = appSceneCostResultValue1.getCountValue(); + if (countValue != null) { + totalCost = totalCost.add(new BigDecimal(countValue)); + } + loopCount(appSceneCostResultValue1, parentMaterialNoMap, topMaterialCode, taskType, taskCode, flowInstanceId, totalCost); + } + } + return totalCost; + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostParameters.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostParameters.java new file mode 100644 index 0000000..6860769 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostParameters.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.laborcost; + + +import com.zzsmart.qomo.plugin.task.api.model.ResourceInfo; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; + +import java.util.ArrayList; +import java.util.List; + +/** + * + */ +public class LaborCostParameters extends AbstractParameters { + @Override + public boolean checkParameters() { + return true; + } + + @Override + public List getResourceFilesList() { + return new ArrayList<>(); + } + + @Override + public void dealOutParam(String result) { + + } + + @Override + public String toString() { + return getLocalParams().toString(); +// return "人工成本任务"; + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTask.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTask.java new file mode 100644 index 0000000..ecf054f --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTask.java @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.laborcost; + +import com.zzsmart.qomo.kn.cost.manage.plugin.StandardCostService; +import com.zzsmart.qomo.plugin.task.api.*; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; + +/** + * 人工成本计算任务 + */ +public class LaborCostTask extends AbstractTask { + /** + * taskExecutionContext + */ + private TaskExecutionContext taskExecutionContext; + + /** + * sql parameters + */ + private LaborCostParameters emptyParameters; + + + /** + * Abstract Yarn Task + * + * @param taskRequest taskRequest + */ + public LaborCostTask(TaskExecutionContext taskRequest) { + super(taskRequest); + this.taskExecutionContext = taskRequest; + this.emptyParameters = new LaborCostParameters(); + } + + @Override + public AbstractParameters getParameters() { + return emptyParameters; + } + + @Override + public void handle(TaskCallBack taskCallBack) throws TaskException { + log.info("Full EmptyTask parameters: {}", taskExecutionContext); + try { + StandardCostService.laborCostTask(taskExecutionContext); + } catch (Exception e) { + //运行失败退出 + setExitStatusCode(TaskConstants.EXIT_CODE_FAILURE); + } + //运行成功退出 + setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS); + } + + @Override + public void cancel() throws TaskException { + + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannel.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannel.java new file mode 100644 index 0000000..79018f2 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannel.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.laborcost; + + +import com.zzsmart.qomo.common.utils.JSONUtils; +import com.zzsmart.qomo.plugin.task.api.AbstractTask; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; +import com.zzsmart.qomo.plugin.task.api.parameters.ParametersNode; +import com.zzsmart.qomo.plugin.task.api.parameters.resource.ResourceParametersHelper; + + +public class LaborCostTaskChannel implements TaskChannel { + + @Override + public void cancelApplication(boolean status) { + + } + + @Override + public AbstractTask createTask(TaskExecutionContext taskRequest) { + return new LaborCostTask(taskRequest); + } + + @Override + public AbstractParameters parseParameters(ParametersNode parametersNode) { + return JSONUtils.parseObject(parametersNode.getTaskParams(), LaborCostParameters.class); + } + + @Override + public ResourceParametersHelper getResources(String parameters) { + return JSONUtils.parseObject(parameters, LaborCostParameters.class).getResources(); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannelFactory.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannelFactory.java new file mode 100644 index 0000000..78e148d --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/laborcost/LaborCostTaskChannelFactory.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.laborcost; + +import com.google.auto.service.AutoService; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskChannelFactory; +import com.zzsmart.qomo.spi.params.base.PluginParams; + +import java.util.List; + +@AutoService(TaskChannelFactory.class) +public class LaborCostTaskChannelFactory implements TaskChannelFactory { + + @Override + public String getName() { + return "LaborCost"; + } + + @Override + public List getParams() { + return null; + } + + @Override + public TaskChannel create() { + return new LaborCostTaskChannel(); + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostParameters.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostParameters.java new file mode 100644 index 0000000..fd6b280 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostParameters.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.manufacturingcost; + + +import com.zzsmart.qomo.plugin.task.api.model.ResourceInfo; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; + +import java.util.ArrayList; +import java.util.List; + +/** + * + */ +public class ManufacturingCostParameters extends AbstractParameters { + @Override + public boolean checkParameters() { + return true; + } + + @Override + public List getResourceFilesList() { + return new ArrayList<>(); + } + + @Override + public void dealOutParam(String result) { + + } + + @Override + public String toString() { + return "制造费用成本任务"; + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTask.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTask.java new file mode 100644 index 0000000..6b41f15 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTask.java @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.manufacturingcost; + +import com.zzsmart.qomo.kn.cost.manage.plugin.StandardCostService; +import com.zzsmart.qomo.plugin.task.api.*; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; + +/** + * 制造费用成本任务 + */ +public class ManufacturingCostTask extends AbstractTask { + /** + * taskExecutionContext + */ + private TaskExecutionContext taskExecutionContext; + + /** + * sql parameters + */ + private ManufacturingCostParameters emptyParameters; + + + /** + * Abstract Yarn Task + * + * @param taskRequest taskRequest + */ + public ManufacturingCostTask(TaskExecutionContext taskRequest) { + super(taskRequest); + this.taskExecutionContext = taskRequest; + this.emptyParameters = new ManufacturingCostParameters(); + } + + @Override + public AbstractParameters getParameters() { + return emptyParameters; + } + + @Override + public void handle(TaskCallBack taskCallBack) throws TaskException { + log.info("Full EmptyTask parameters: {}", taskRequest); + try { + StandardCostService.manufacturingCostTask(taskRequest); + } catch (Exception e) { + //运行失败退出 + setExitStatusCode(TaskConstants.EXIT_CODE_FAILURE); + } + //运行成功退出 + setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS); + } + + @Override + public void cancel() throws TaskException { + + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannel.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannel.java new file mode 100644 index 0000000..8defc02 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannel.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.manufacturingcost; + + +import com.zzsmart.qomo.common.utils.JSONUtils; +import com.zzsmart.qomo.plugin.task.api.AbstractTask; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; +import com.zzsmart.qomo.plugin.task.api.parameters.ParametersNode; +import com.zzsmart.qomo.plugin.task.api.parameters.resource.ResourceParametersHelper; + + +public class ManufacturingCostTaskChannel implements TaskChannel { + + @Override + public void cancelApplication(boolean status) { + + } + + @Override + public AbstractTask createTask(TaskExecutionContext taskRequest) { + return new ManufacturingCostTask(taskRequest); + } + + @Override + public AbstractParameters parseParameters(ParametersNode parametersNode) { + return JSONUtils.parseObject(parametersNode.getTaskParams(), ManufacturingCostParameters.class); + } + + @Override + public ResourceParametersHelper getResources(String parameters) { + return JSONUtils.parseObject(parameters, ManufacturingCostParameters.class).getResources(); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannelFactory.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannelFactory.java new file mode 100644 index 0000000..83d7e6f --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/manufacturingcost/ManufacturingCostTaskChannelFactory.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.manufacturingcost; + +import com.google.auto.service.AutoService; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskChannelFactory; +import com.zzsmart.qomo.spi.params.base.PluginParams; + +import java.util.List; + +@AutoService(TaskChannelFactory.class) +public class ManufacturingCostTaskChannelFactory implements TaskChannelFactory { + + @Override + public String getName() { + return "ManufacturingCost"; + } + + @Override + public List getParams() { + return null; + } + + @Override + public TaskChannel create() { + return new ManufacturingCostTaskChannel(); + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostParameters.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostParameters.java new file mode 100644 index 0000000..2f84721 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostParameters.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.materialcost; + + +import com.zzsmart.qomo.plugin.task.api.model.ResourceInfo; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; + +import java.util.ArrayList; +import java.util.List; + +/** + * + */ +public class MaterialCostParameters extends AbstractParameters { + @Override + public boolean checkParameters() { + return true; + } + + @Override + public List getResourceFilesList() { + return new ArrayList<>(); + } + + @Override + public void dealOutParam(String result) { + + } + + @Override + public String toString() { + return "物料成本任务"; + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTask.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTask.java new file mode 100644 index 0000000..e1728f1 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTask.java @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.materialcost; + +import com.zzsmart.qomo.kn.cost.manage.plugin.StandardCostService; +import com.zzsmart.qomo.plugin.task.api.*; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; + +/** + * 物料成本计算任务 + */ +public class MaterialCostTask extends AbstractTask { + /** + * taskExecutionContext + */ + private TaskExecutionContext taskExecutionContext; + + /** + * sql parameters + */ + private MaterialCostParameters emptyParameters; + + + /** + * Abstract Yarn Task + * + * @param taskRequest taskRequest + */ + public MaterialCostTask(TaskExecutionContext taskRequest) { + super(taskRequest); + this.taskExecutionContext = taskRequest; + this.emptyParameters = new MaterialCostParameters(); + } + + @Override + public AbstractParameters getParameters() { + return emptyParameters; + } + + @Override + public void handle(TaskCallBack taskCallBack) throws TaskException { + log.info("Full EmptyTask parameters: {}", taskExecutionContext); + try { + StandardCostService.materialCostTask(taskExecutionContext); + } catch (Exception e) { + //运行失败退出 + setExitStatusCode(TaskConstants.EXIT_CODE_FAILURE); + } + //运行成功退出 + setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS); + } + + @Override + public void cancel() throws TaskException { + + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannel.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannel.java new file mode 100644 index 0000000..8883b9d --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannel.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.materialcost; + + +import com.zzsmart.qomo.common.utils.JSONUtils; +import com.zzsmart.qomo.plugin.task.api.AbstractTask; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; +import com.zzsmart.qomo.plugin.task.api.parameters.ParametersNode; +import com.zzsmart.qomo.plugin.task.api.parameters.resource.ResourceParametersHelper; + + +public class MaterialCostTaskChannel implements TaskChannel { + + @Override + public void cancelApplication(boolean status) { + + } + + @Override + public AbstractTask createTask(TaskExecutionContext taskRequest) { + return new MaterialCostTask(taskRequest); + } + + @Override + public AbstractParameters parseParameters(ParametersNode parametersNode) { + return JSONUtils.parseObject(parametersNode.getTaskParams(), MaterialCostParameters.class); + } + + @Override + public ResourceParametersHelper getResources(String parameters) { + return JSONUtils.parseObject(parameters, MaterialCostParameters.class).getResources(); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannelFactory.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannelFactory.java new file mode 100644 index 0000000..b46e669 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialcost/MaterialCostTaskChannelFactory.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.materialcost; + +import com.google.auto.service.AutoService; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskChannelFactory; +import com.zzsmart.qomo.spi.params.base.PluginParams; + +import java.util.List; + +@AutoService(TaskChannelFactory.class) +public class MaterialCostTaskChannelFactory implements TaskChannelFactory { + + @Override + public String getName() { + return "MaterialCost"; + } + + @Override + public List getParams() { + return null; + } + + @Override + public TaskChannel create() { + return new MaterialCostTaskChannel(); + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputParameters.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputParameters.java new file mode 100644 index 0000000..fc32246 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputParameters.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.materialinput; + + +import com.zzsmart.qomo.plugin.task.api.model.ResourceInfo; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; + +import java.util.ArrayList; +import java.util.List; + +/** + * + */ +public class MaterialInputParameters extends AbstractParameters { + @Override + public boolean checkParameters() { + return true; + } + + @Override + public List getResourceFilesList() { + return new ArrayList<>(); + } + + @Override + public void dealOutParam(String result) { + + } + + @Override + public String toString() { + return "物料编号输入任务"; + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTask.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTask.java new file mode 100644 index 0000000..5dda9dd --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTask.java @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.materialinput; + +import com.zzsmart.qomo.kn.cost.manage.plugin.StandardCostService; +import com.zzsmart.qomo.plugin.task.api.*; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; + +/** + * 物料编号输入任务 + */ +public class MaterialInputTask extends AbstractTask { + /** + * taskExecutionContext + */ + private TaskExecutionContext taskExecutionContext; + + /** + * sql parameters + */ + private MaterialInputParameters emptyParameters; + + + /** + * Abstract Yarn Task + * + * @param taskRequest taskRequest + */ + public MaterialInputTask(TaskExecutionContext taskRequest) { + super(taskRequest); + this.taskExecutionContext = taskRequest; + this.emptyParameters = new MaterialInputParameters(); + } + + @Override + public AbstractParameters getParameters() { + return emptyParameters; + } + + @Override + public void handle(TaskCallBack taskCallBack) throws TaskException { + log.info("Full EmptyTask parameters: {}", taskExecutionContext); + try { + StandardCostService.materialInputTask(taskExecutionContext); + } catch (Exception e) { + //运行失败退出 + setExitStatusCode(TaskConstants.EXIT_CODE_FAILURE); + } + //运行成功退出 + setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS); + } + + @Override + public void cancel() throws TaskException { + + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannel.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannel.java new file mode 100644 index 0000000..a6e0293 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannel.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.materialinput; + + +import com.zzsmart.qomo.common.utils.JSONUtils; +import com.zzsmart.qomo.plugin.task.api.AbstractTask; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; +import com.zzsmart.qomo.plugin.task.api.parameters.ParametersNode; +import com.zzsmart.qomo.plugin.task.api.parameters.resource.ResourceParametersHelper; + + +public class MaterialInputTaskChannel implements TaskChannel { + + @Override + public void cancelApplication(boolean status) { + + } + + @Override + public AbstractTask createTask(TaskExecutionContext taskRequest) { + return new MaterialInputTask(taskRequest); + } + + @Override + public AbstractParameters parseParameters(ParametersNode parametersNode) { + return JSONUtils.parseObject(parametersNode.getTaskParams(), MaterialInputParameters.class); + } + + @Override + public ResourceParametersHelper getResources(String parameters) { + return JSONUtils.parseObject(parameters, MaterialInputParameters.class).getResources(); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannelFactory.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannelFactory.java new file mode 100644 index 0000000..a4ecd74 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/materialinput/MaterialInputTaskChannelFactory.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.materialinput; + +import com.google.auto.service.AutoService; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskChannelFactory; +import com.zzsmart.qomo.spi.params.base.PluginParams; + +import java.util.List; + +@AutoService(TaskChannelFactory.class) +public class MaterialInputTaskChannelFactory implements TaskChannelFactory { + + @Override + public String getName() { + return "MaterialInput"; + } + + @Override + public List getParams() { + return null; + } + + @Override + public TaskChannel create() { + return new MaterialInputTaskChannel(); + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostParameters.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostParameters.java new file mode 100644 index 0000000..ebf9b1e --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostParameters.java @@ -0,0 +1,51 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.standardcost; + + +import com.zzsmart.qomo.plugin.task.api.model.ResourceInfo; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; + +import java.util.ArrayList; +import java.util.List; + +/** + * + */ +public class StandardCostParameters extends AbstractParameters { + @Override + public boolean checkParameters() { + return true; + } + + @Override + public List getResourceFilesList() { + return new ArrayList<>(); + } + + @Override + public void dealOutParam(String result) { + + } + + @Override + public String toString() { + return "标准成本计算任务"; + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTask.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTask.java new file mode 100644 index 0000000..81d2702 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTask.java @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.standardcost; + +import com.zzsmart.qomo.kn.cost.manage.plugin.StandardCostService; +import com.zzsmart.qomo.plugin.task.api.*; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; + +/** + * 标准成本计算任务 + */ +public class StandardCostTask extends AbstractTask { + + /** + * taskExecutionContext + */ + private TaskExecutionContext taskExecutionContext; + + /** + * sql parameters + */ + private StandardCostParameters emptyParameters; + + + /** + * Abstract Yarn Task + * + * @param taskRequest taskRequest + */ + public StandardCostTask(TaskExecutionContext taskRequest) { + super(taskRequest); + this.taskExecutionContext = taskRequest; + this.emptyParameters = new StandardCostParameters(); + } + + @Override + public AbstractParameters getParameters() { + return emptyParameters; + } + + @Override + public void handle(TaskCallBack taskCallBack) throws TaskException { + log.info("Full EmptyTask parameters: {}", taskRequest); + try { + StandardCostService.standardCostTask(taskRequest); + } catch (Exception e) { + //TODO 更新成本计算模型任务状态 + StandardCostService.updateCostCountTaskStatus(false, 1); + //运行失败退出 + setExitStatusCode(TaskConstants.EXIT_CODE_FAILURE); + } + //运行成功退出 + //TODO 更新成本计算模型任务状态 + StandardCostService.updateCostCountTaskStatus(true, 1); + setExitStatusCode(TaskConstants.EXIT_CODE_SUCCESS); + } + + @Override + public void cancel() throws TaskException { + + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannel.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannel.java new file mode 100644 index 0000000..1c6ae08 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannel.java @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.standardcost; + + +import com.zzsmart.qomo.common.utils.JSONUtils; +import com.zzsmart.qomo.plugin.task.api.AbstractTask; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskExecutionContext; +import com.zzsmart.qomo.plugin.task.api.parameters.AbstractParameters; +import com.zzsmart.qomo.plugin.task.api.parameters.ParametersNode; +import com.zzsmart.qomo.plugin.task.api.parameters.resource.ResourceParametersHelper; + + +public class StandardCostTaskChannel implements TaskChannel { + + @Override + public void cancelApplication(boolean status) { + + } + + @Override + public AbstractTask createTask(TaskExecutionContext taskRequest) { + return new StandardCostTask(taskRequest); + } + + @Override + public AbstractParameters parseParameters(ParametersNode parametersNode) { + return JSONUtils.parseObject(parametersNode.getTaskParams(), StandardCostParameters.class); + } + + @Override + public ResourceParametersHelper getResources(String parameters) { + return JSONUtils.parseObject(parameters, StandardCostParameters.class).getResources(); + } + +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannelFactory.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannelFactory.java new file mode 100644 index 0000000..fc9ad4f --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/plugin/standardcost/StandardCostTaskChannelFactory.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.zzsmart.qomo.kn.cost.manage.plugin.standardcost; + +import com.google.auto.service.AutoService; +import com.zzsmart.qomo.plugin.task.api.TaskChannel; +import com.zzsmart.qomo.plugin.task.api.TaskChannelFactory; +import com.zzsmart.qomo.spi.params.base.PluginParams; + +import java.util.List; + +@AutoService(TaskChannelFactory.class) +public class StandardCostTaskChannelFactory implements TaskChannelFactory { + + @Override + public String getName() { + return "StandardCost"; + } + + @Override + public List getParams() { + return null; + } + + @Override + public TaskChannel create() { + return new StandardCostTaskChannel(); + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostMaterialBomService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostMaterialBomService.java index 1b752bc..79f47c2 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostMaterialBomService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostMaterialBomService.java @@ -3,14 +3,28 @@ package com.zzsmart.qomo.kn.cost.manage.service; import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** *

* 物料bom 服务类 *

* - * @author - * @since 2024-06-19 + * @author + * @since 2024-06-21 */ public interface CostMaterialBomService 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/CostMaterialProcessHoursService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostMaterialProcessHoursService.java index c8957cc..182a7a7 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostMaterialProcessHoursService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostMaterialProcessHoursService.java @@ -3,6 +3,9 @@ package com.zzsmart.qomo.kn.cost.manage.service; import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialProcessHours; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; +import java.util.Map; + /** *

* 物料工时工序表 服务类 @@ -12,5 +15,8 @@ import com.baomidou.mybatisplus.extension.service.IService; * @since 2024-06-19 */ public interface CostMaterialProcessHoursService extends IService { - +/** + * 查询满足物料编号的工时工序 + */ + Map> getProcessHoursByMaterialNo(List materialNos); } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostPurchasePriceService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostPurchasePriceService.java index cac2eb2..4a7d836 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostPurchasePriceService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostPurchasePriceService.java @@ -1,8 +1,13 @@ package com.zzsmart.qomo.kn.cost.manage.service; +import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialProcessHours; import com.zzsmart.qomo.kn.cost.manage.entity.CostPurchasePrice; import com.baomidou.mybatisplus.extension.service.IService; +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + /** *

* 物料采购单价 服务类 @@ -12,5 +17,8 @@ import com.baomidou.mybatisplus.extension.service.IService; * @since 2024-06-19 */ public interface CostPurchasePriceService extends IService { - + /** + * 查询满足物料编号的最低采购价 + */ + Map getMinCostPurchasePriceByMaterialNo(List materialNos); } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostStandardDetailService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostStandardDetailService.java index e2ca314..7395b14 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostStandardDetailService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/CostStandardDetailService.java @@ -1,27 +1,41 @@ package com.zzsmart.qomo.kn.cost.manage.service; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardDetail; import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardDetail; +import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailSearch; import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailVO; -import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardVO; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; /** *

* 标准成本明细表 服务类 *

* - * @author cost_purchase_price + * @author app_scene_cost_purchase_price * @since 2024-06-19 */ public interface CostStandardDetailService extends IService { /** * 分页查询 + * * @param page * @param * @return */ IPage pageList(Page page, CostStandardDetailVO costStandard); + /** + * 导出列表信息为Excel文件 + * + * @param request + * @param response + * @param costStandardDetailSearch + * @return + */ + JSONObject exportExcel(HttpServletRequest request, HttpServletResponse response, CostStandardDetailSearch costStandardDetailSearch); } 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 new file mode 100644 index 0000000..865605e --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostCountService.java @@ -0,0 +1,32 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount; + +/** + * @Description: app_scene_cost_count + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +public interface IAppSceneCostCountService extends IService { + /** + * 查看关键缺失部件 + * @param id + * @return + */ + AppSceneCostCount queryMissingComponentById(String id); + + /** + * 重新计算 + * @param id + * @return + */ + AppSceneCostCount recountById(Integer id); + + /** + * 添加标准成本计算任务 + * @param appSceneCostCount + */ + void addCostCountTask(AppSceneCostCount appSceneCostCount); +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostModelService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostModelService.java new file mode 100644 index 0000000..3f60d28 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostModelService.java @@ -0,0 +1,24 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.dao.entity.FlowDefinition; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostModel; + +import java.util.List; + +/** + * @Description: app_scene_cost_model + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +public interface IAppSceneCostModelService { + /** + * 查询标准成本模型列表 + * + * @param queryWrapper + * @return + */ + List queryListResult(Wrapper queryWrapper); +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostResultValueService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostResultValueService.java new file mode 100644 index 0000000..b2474e3 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IAppSceneCostResultValueService.java @@ -0,0 +1,21 @@ +package com.zzsmart.qomo.kn.cost.manage.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostResultValue; + +import java.util.List; + +/** + * @Description: app_scene_cost_result_value + * @Author: jeecg-boot + * @Date: 2024-07-22 + * @Version: V1.0 + */ +public interface IAppSceneCostResultValueService extends IService { + /** + * 根据顶级物料编码查询满足条件的结果值 + * @param topMaterialCode + * @return + */ + List getResultValueByTopMaterialNo(String topMaterialCode,String taskType,String flowInstanceId); +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IBudgetPriceService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IBudgetPriceService.java deleted file mode 100644 index 25b6392..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IBudgetPriceService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service; - -import com.zzsmart.qomo.kn.cost.manage.entity.BudgetPrice; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - * @Description: budget_price - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -public interface IBudgetPriceService extends IService { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IC7525costService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IC7525costService.java deleted file mode 100644 index 250e666..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IC7525costService.java +++ /dev/null @@ -1,15 +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.C7525cost; - -/** - * @Description: c7525cost - * @Author: jeecg-boot - * @Date: 2024-06-06 - * @Version: V1.0 - */ -public interface IC7525costService extends IService { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostCenterService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostCenterService.java deleted file mode 100644 index c6c9d01..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostCenterService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service; - -import com.zzsmart.qomo.kn.cost.manage.entity.CostCenter; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - * @Description: cost_center - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -public interface ICostCenterService extends IService { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostStandardService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostStandardService.java deleted file mode 100644 index efdaa50..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostStandardService.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service; - -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.baomidou.mybatisplus.extension.service.IService; -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandard; -import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardVO; - -import javax.servlet.http.HttpServletRequest; - -/** - * @Description: 标准成本 - * @Author: wangqiong - * @Date: 2024-06-13 - * @Version: V1.0 - */ -public interface ICostStandardService extends IService { - /** - * 分页查询 - * @param page - * @param - * @return - */ - IPage pageList(Page page, CostStandardVO costStandard); -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostStandardVersionService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostStandardVersionService.java index f4e69c4..9086cbd 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostStandardVersionService.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ICostStandardVersionService.java @@ -2,11 +2,13 @@ package com.zzsmart.qomo.kn.cost.manage.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.zzsmart.qomo.kn.cost.manage.entity.CostMaterialBom; import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion; import org.jeecg.common.api.vo.Result; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.util.List; /** @@ -24,5 +26,10 @@ public interface ICostStandardVersionService extends IService importExcel(HttpServletRequest request, HttpServletResponse response, Class costStandardVersionClass); - + /** + * 分页查询 + * @param + * @return + */ + List queryListResult(String versionNumber); } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ILatestPurchasePriceService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ILatestPurchasePriceService.java deleted file mode 100644 index 93c39f7..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ILatestPurchasePriceService.java +++ /dev/null @@ -1,15 +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.LatestPurchasePrice; - -/** - * @Description: latest_purchase_price - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -public interface ILatestPurchasePriceService extends IService { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IProduceBatchService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IProduceBatchService.java deleted file mode 100644 index 276c1c5..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/IProduceBatchService.java +++ /dev/null @@ -1,14 +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.ProduceBatch; - -/** - * @Description: produce_batch - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -public interface IProduceBatchService extends IService { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ISapSubfactoryService.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ISapSubfactoryService.java deleted file mode 100644 index 961a42a..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/ISapSubfactoryService.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service; - -import com.zzsmart.qomo.kn.cost.manage.entity.SapSubfactory; -import com.baomidou.mybatisplus.extension.service.IService; - -/** - * @Description: sap_subfactory - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -public interface ISapSubfactoryService extends IService { - -} 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 new file mode 100644 index 0000000..b05627b --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostCountServiceImpl.java @@ -0,0 +1,88 @@ +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.AppSceneCostCount; +import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostCountMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostCountService; +import com.zzsmart.qomo.kn.cost.manage.service.ICostStandardVersionService; +import com.zzsmart.qomo.service.IDataFlowInstanceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; + +/** + * @Description: app_scene_cost_count + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +@Service +public class AppSceneCostCountServiceImpl extends ServiceImpl implements IAppSceneCostCountService { + @Autowired + private ICostStandardVersionService costStandardVersionService; + @Autowired + private IDataFlowInstanceService flowInstanceService; + + /** + * 查看关键缺失部件 + * + * @param id + * @return + */ + @Override + public AppSceneCostCount queryMissingComponentById(String id) { + return null; + } + + /** + * 重新计算 + * + * @param id + * @return + */ + @Override + public AppSceneCostCount recountById(Integer id) { + if (id != null) { + AppSceneCostCount appSceneCostCount = getById(id); + if (appSceneCostCount != null) { + //执行标准成本计算 + executeStandardCost(id, appSceneCostCount.getFlowDefinitionId()); + } + } + return null; + } + + /** + * 执行标准成本计算 + * + * @param id + * @param flowDefinitionId + */ + private void executeStandardCost(Integer id, Integer flowDefinitionId) { + //TODO 执行标准成本计算(参数传递) + flowInstanceService.execute(flowDefinitionId, null, null); + } + + /** + * 添加标准成本计算任务 + * + * @param appSceneCostCount + */ + @Override + public void addCostCountTask(AppSceneCostCount appSceneCostCount) { + //1.新增版本号记录成功后 + CostStandardVersion costStandardVersion = CostStandardVersion.builder().figureNumber(appSceneCostCount.getDrawingNo()).materialNumber(appSceneCostCount.getMaterialNo()).stage(appSceneCostCount.getStage()).versionNumber(appSceneCostCount.getCostVersion()).versionYear(appSceneCostCount.getYear()).build(); + boolean save = costStandardVersionService.save(costStandardVersion); + //2.新增标准成本计算任务,并立即执行标准成本计算 + if (save) { + AppSceneCostCount appSceneCostCount1 = AppSceneCostCount.builder().materialNo(appSceneCostCount.getMaterialNo()).drawingNo(appSceneCostCount.getDrawingNo()).stage(appSceneCostCount.getStage()).flowDefinitionId(appSceneCostCount.getFlowDefinitionId()).year(appSceneCostCount.getYear()).costVersion(appSceneCostCount.getCostVersion()).status(0).createTime(new Date()).build(); + boolean flag = save(appSceneCostCount1); + if (flag) { + //执行标准成本计算 + executeStandardCost(appSceneCostCount1.getId(), appSceneCostCount1.getFlowDefinitionId()); + } + } + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostModelServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostModelServiceImpl.java new file mode 100644 index 0000000..646f50f --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostModelServiceImpl.java @@ -0,0 +1,34 @@ +package com.zzsmart.qomo.kn.cost.manage.service.impl; + +import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.zzsmart.qomo.dao.entity.FlowDefinition; +import com.zzsmart.qomo.dao.mapper.FlowDefinitionMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostModelService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description: app_scene_cost_model + * @Author: jeecg-boot + * @Date: 2024-07-29 + * @Version: V1.0 + */ +@Service +public class AppSceneCostModelServiceImpl implements IAppSceneCostModelService { + @Autowired + FlowDefinitionMapper flowDefinitionMapper; + + /** + * 查询标准成本模型列表 + * + * @param queryWrapper + * @return + */ + @Override + public List queryListResult(Wrapper queryWrapper) { + List list = flowDefinitionMapper.selectList(queryWrapper); + return list; + } +} 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 new file mode 100644 index 0000000..77a2c2f --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/AppSceneCostResultValueServiceImpl.java @@ -0,0 +1,48 @@ +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.AppSceneCostResultValue; +import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostResultValueMapper; +import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostResultValueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + + +/** + * @Description: app_scene_cost_result_value + * @Author: jeecg-boot + * @Date: 2024-07-22 + * @Version: V1.0 + */ +@Service +public class AppSceneCostResultValueServiceImpl extends ServiceImpl implements IAppSceneCostResultValueService { + @Autowired + private AppSceneCostResultValueMapper appSceneCostResultValueMapper; + + /** + * 根据顶级物料编码查询满足条件的结果值 + * + * @param topMaterialCode + * @param lastTaskType + * @param flowInstanceId + * @return + */ + @Override + public List getResultValueByTopMaterialNo(String topMaterialCode, String lastTaskType, String flowInstanceId) { + List result = new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + if (topMaterialCode != null && !topMaterialCode.equals("") && lastTaskType != null && !lastTaskType.equals("") && flowInstanceId != null && !flowInstanceId.equals("")) { + queryWrapper.eq("belong_top_material_no", topMaterialCode).eq("task_type", lastTaskType).eq("flow_instance_id", flowInstanceId); + result = appSceneCostResultValueMapper.selectList(queryWrapper); + } else if (topMaterialCode != null && !topMaterialCode.equals("") && flowInstanceId != null && !flowInstanceId.equals("")) { + queryWrapper.eq("belong_top_material_no", topMaterialCode).eq("flow_instance_id", flowInstanceId); + result = appSceneCostResultValueMapper.selectList(queryWrapper); + } + return result; + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java index 154fc96..cb3daf1 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BomTreeServiceImpl.java @@ -8,13 +8,19 @@ import com.zzsmart.qomo.kn.cost.manage.service.BomTreeService; import com.zzsmart.qomo.kn.cost.manage.util.BomTreeBuilder; import com.zzsmart.qomo.kn.cost.manage.vo.BomTreeInfoVO; import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailVO; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; -import java.util.Arrays; +import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.TreeMap; +import java.util.stream.Collectors; @Service +@Transactional public class BomTreeServiceImpl implements BomTreeService { @Autowired CostStandardDetailMapper costStandardDetailMapper; @@ -37,8 +43,60 @@ public class BomTreeServiceImpl implements BomTreeService { // 版本号 wrapper.like("c2.version_number", version_number); } - List costStandardDetailVOS = costStandardDetailMapper.queryListResult(wrapper); - List bomTreeInfoVOS = BomTreeBuilder.buildBomTree(costStandardDetailVOS); + //查询所有满足条件的父节点 + List parentNodeList = costStandardDetailMapper.queryListResult(wrapper); + //所有子类节点 + List childrenNodeList = new ArrayList<>(); + Map parentDataMap = new TreeMap<>(); + if (parentNodeList.size() > 0) { + //父类结果只有1个 + if (parentNodeList.size() == 1) { + parentDataMap = parentNodeList.stream().collect(Collectors.toMap(CostStandardDetailVO::getMaterialNumber, vo -> vo)); + } else { + //父类结果有多个(找出最上级节点) + Map> levelGroupMap = parentNodeList.stream().collect(Collectors.groupingBy(CostStandardDetailVO::getLevel)); + TreeMap> levelTreeMap = new TreeMap<>(levelGroupMap); + parentDataMap = levelTreeMap.firstEntry().getValue().stream().collect(Collectors.toMap(CostStandardDetailVO::getMaterialNumber, vo -> vo)); + } + //查询所有父节点下的子节点(即第二层叶子节点) + List costStandardDetails = new ArrayList<>(); + if (parentDataMap.size() > 0) { + QueryWrapper wrapper1 = new QueryWrapper<>(); + int num = 0; + for (String materialNumber1 : parentDataMap.keySet()) { + num = num + 1; + if (num > 1) { + wrapper1.or().eq("parent_material_number", materialNumber1); + } else { + wrapper1.eq("parent_material_number", materialNumber1); + } + } + costStandardDetails = costStandardDetailMapper.selectList(wrapper1); + } + //第三层叶子节点 + List threeNodes = new ArrayList<>(); + if (costStandardDetails != null && costStandardDetails.size() > 0) { + List materialNoList = costStandardDetails.stream().map(CostStandardDetail::getMaterialNumber).collect(Collectors.toList()); + QueryWrapper wrapper2 = new QueryWrapper<>(); + wrapper2.in("parent_material_number", materialNoList); + threeNodes = costStandardDetailMapper.selectList(wrapper2); + } + //把第二层叶子节点转化为bomtreeinfoVO对象集合 + for (int i = 0; i < costStandardDetails.size(); i++) { + CostStandardDetail costStandardDetail = costStandardDetails.get(i); + CostStandardDetailVO vo = new CostStandardDetailVO(); + BeanUtils.copyProperties(costStandardDetail, vo); + childrenNodeList.add(vo); + } + //把第三层叶子节点转化为bomtreeinfoVO对象集合 + for (int i = 0; i < threeNodes.size(); i++) { + CostStandardDetail costStandardDetail = threeNodes.get(i); + CostStandardDetailVO vo = new CostStandardDetailVO(); + BeanUtils.copyProperties(costStandardDetail, vo); + childrenNodeList.add(vo); + } + } + List bomTreeInfoVOS = BomTreeBuilder.buildBomTree(childrenNodeList, parentDataMap); return bomTreeInfoVOS; } } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BudgetPriceServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BudgetPriceServiceImpl.java deleted file mode 100644 index 527dd0d..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/BudgetPriceServiceImpl.java +++ /dev/null @@ -1,18 +0,0 @@ -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.BudgetPrice; -import com.zzsmart.qomo.kn.cost.manage.mapper.BudgetPriceMapper; -import com.zzsmart.qomo.kn.cost.manage.service.IBudgetPriceService; -import org.springframework.stereotype.Service; - -/** - * @Description: budget_price - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -@Service -public class BudgetPriceServiceImpl extends ServiceImpl implements IBudgetPriceService { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/C7525costServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/C7525costServiceImpl.java deleted file mode 100644 index df2d814..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/C7525costServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service.impl; - - -import com.zzsmart.qomo.kn.cost.manage.entity.C7525cost; -import com.zzsmart.qomo.kn.cost.manage.mapper.C7525costMapper; -import com.zzsmart.qomo.kn.cost.manage.service.IC7525costService; -import org.springframework.stereotype.Service; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; - -/** - * @Description: c7525cost - * @Author: jeecg-boot - * @Date: 2024-06-06 - * @Version: V1.0 - */ -@Service -public class C7525costServiceImpl extends ServiceImpl implements IC7525costService { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostCenterServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostCenterServiceImpl.java deleted file mode 100644 index 34e9c1a..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostCenterServiceImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service.impl; - -import com.zzsmart.qomo.kn.cost.manage.entity.CostCenter; -import com.zzsmart.qomo.kn.cost.manage.mapper.CostCenterMapper; -import com.zzsmart.qomo.kn.cost.manage.service.ICostCenterService; -import org.springframework.stereotype.Service; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; - -/** - * @Description: cost_center - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -@Service -public class CostCenterServiceImpl extends ServiceImpl implements ICostCenterService { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostMaterialBomServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostMaterialBomServiceImpl.java index 91a29ff..4f4147b 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostMaterialBomServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostMaterialBomServiceImpl.java @@ -1,20 +1,61 @@ 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.CostMaterialBom; import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialBomMapper; import com.zzsmart.qomo.kn.cost.manage.service.CostMaterialBomService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** *

* 物料bom 服务实现类 *

* - * @author - * @since 2024-06-19 + * @author + * @since 2024-06-21 */ @Service public class CostMaterialBomServiceImpl extends ServiceImpl implements CostMaterialBomService { + @Autowired + CostMaterialBomMapper 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/CostMaterialProcessHoursServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostMaterialProcessHoursServiceImpl.java index f47c888..7c8a3b8 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostMaterialProcessHoursServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostMaterialProcessHoursServiceImpl.java @@ -1,20 +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.CostMaterialProcessHours; import com.zzsmart.qomo.kn.cost.manage.mapper.CostMaterialProcessHoursMapper; import com.zzsmart.qomo.kn.cost.manage.service.CostMaterialProcessHoursService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +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; + /** *

* 物料工时工序表 服务实现类 *

* - * @author + * @author * @since 2024-06-19 */ @Service public class CostMaterialProcessHoursServiceImpl extends ServiceImpl implements CostMaterialProcessHoursService { + @Autowired + CostMaterialProcessHoursMapper 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++) { + CostMaterialProcessHours 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/CostPurchasePriceServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostPurchasePriceServiceImpl.java index 2febebe..d93f624 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostPurchasePriceServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostPurchasePriceServiceImpl.java @@ -1,20 +1,51 @@ 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.CostMaterialProcessHours; import com.zzsmart.qomo.kn.cost.manage.entity.CostPurchasePrice; import com.zzsmart.qomo.kn.cost.manage.mapper.CostPurchasePriceMapper; import com.zzsmart.qomo.kn.cost.manage.service.CostPurchasePriceService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.checkerframework.checker.units.qual.A; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** *

* 物料采购单价 服务实现类 *

* - * @author + * @author * @since 2024-06-19 */ @Service public class CostPurchasePriceServiceImpl extends ServiceImpl implements CostPurchasePriceService { + @Autowired + CostPurchasePriceMapper 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++) { + CostPurchasePrice 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/CostStandardDetailServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardDetailServiceImpl.java index f1e3403..e7cce2e 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardDetailServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardDetailServiceImpl.java @@ -1,24 +1,34 @@ package com.zzsmart.qomo.kn.cost.manage.service.impl; import cn.hutool.core.util.StrUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.fastjson.JSONObject; 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardDetail; import com.zzsmart.qomo.kn.cost.manage.mapper.CostStandardDetailMapper; import com.zzsmart.qomo.kn.cost.manage.service.CostStandardDetailService; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailSearch; import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardDetailVO; -import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardVO; +import org.jeecg.common.system.query.QueryGenerator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Set; + +import static com.zzsmart.qomo.kn.cost.manage.util.EasyExcelUtil.getIncludeFields; + /** *

* 标准成本明细表 服务实现类 *

* - * @author cost_purchase_price + * @author app_scene_cost_purchase_price * @since 2024-06-19 */ @Service @@ -26,6 +36,7 @@ public class CostStandardDetailServiceImpl extends ServiceImpl) costStandardDetailMapper.pageList(page,queryWrapper); + return (IPage) costStandardDetailMapper.pageList(page, queryWrapper); } + + @Override + public JSONObject exportExcel(HttpServletRequest request, HttpServletResponse response, CostStandardDetailSearch costStandardDetailSearch) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(costStandardDetailSearch, request.getParameterMap()); + if (costStandardDetailSearch != null && costStandardDetailSearch.getSelections() != null && costStandardDetailSearch.getSelections().size() > 0) { + queryWrapper.in("id", costStandardDetailSearch.getSelections()); + } + List exportList = list(queryWrapper); +// EasyExcelUtil.export(response, "D:/WorkDoc/PHM/单机部署/单行查询.xls", null, exportList,CostStandardDetail.class); + // 根据用户传入字段 假设我们要忽略 date + Set includeFields = getIncludeFields(CostStandardDetail.class); + EasyExcel.write("D:/WorkDoc/PHM/单机部署/单行查询.xls", CostStandardDetail.class).includeColumnFieldNames(includeFields).sheet("模板").doWrite(exportList); + // return super.exportXls(request, costStandardDetail, CostStandardDetail.class, "单行查询"); + JSONObject result = new JSONObject(); + result.put("filePath", "D:/WorkDoc/PHM/单机部署/单行查询.xls"); + return result; + } + } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardServiceImpl.java deleted file mode 100644 index ee58c95..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardServiceImpl.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.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandard; -import com.zzsmart.qomo.kn.cost.manage.mapper.CostStandardMapper; -import com.zzsmart.qomo.kn.cost.manage.service.ICostStandardService; -import com.zzsmart.qomo.kn.cost.manage.vo.CostStandardVO; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; -import java.util.Map; - -/** - * @Description: 标准成本 - * @Author: wangqiong - * @Date: 2024-06-13 - * @Version: V1.0 - */ -@Service -public class CostStandardServiceImpl extends ServiceImpl implements ICostStandardService { - @Autowired - private CostStandardMapper costStandardMapper; - - @Override - public IPage pageList(Page page, CostStandardVO costStandard) { - // 查询条件组装 - QueryWrapper queryWrapper = new QueryWrapper(); - - if(costStandard != null){ - if(StrUtil.isNotEmpty(costStandard.getVersionYear()) ){ - // 年份 - queryWrapper.eq("c2.version_year",costStandard.getVersionYear()); - } - if(StrUtil.isNotEmpty(costStandard.getStage()) ){ - // 阶段 - queryWrapper.eq("c2.stage",costStandard.getStage()); - } - if(StrUtil.isNotEmpty(costStandard.getMaterialNumber()) ){ - // 物料号 - queryWrapper.like("c1.material_number",costStandard.getMaterialNumber()); - } - if(StrUtil.isNotEmpty(costStandard.getVersionNumber()) ){ - // 版本号 - queryWrapper.like("c2.version_number",costStandard.getVersionNumber()); - } - if(StrUtil.isNotEmpty(costStandard.getVersionStatus()) ){ - // 版本状态 - queryWrapper.eq("c2.version_status",costStandard.getVersionStatus()); - } - } - return (IPage) costStandardMapper.pageList(page,queryWrapper); - } -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardVersionServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardVersionServiceImpl.java index db76eaa..fabb5b6 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardVersionServiceImpl.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/CostStandardVersionServiceImpl.java @@ -3,18 +3,15 @@ package com.zzsmart.qomo.kn.cost.manage.service.impl; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.zzsmart.qomo.kn.cost.manage.constants.Constants; -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandard; import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardVersion; import com.zzsmart.qomo.kn.cost.manage.enums.StandardStageEnum; -import com.zzsmart.qomo.kn.cost.manage.mapper.CostStandardMapper; import com.zzsmart.qomo.kn.cost.manage.mapper.CostStandardVersionMapper; import com.zzsmart.qomo.kn.cost.manage.service.ICostStandardVersionService; import org.apache.shiro.SecurityUtils; import org.jeecg.common.api.vo.Result; -import org.jeecg.common.exception.JeecgBootException; -import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.vo.LoginUser; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.entity.ImportParams; @@ -48,7 +45,7 @@ import java.util.Map; @Service public class CostStandardVersionServiceImpl extends ServiceImpl implements ICostStandardVersionService { @Autowired - private CostStandardMapper costStandardMapper; + private CostStandardVersionMapper costStandardVersionMapper; private static final Logger log = LoggerFactory.getLogger(CostStandardVersionServiceImpl.class); @Transactional(rollbackFor = Exception.class) @@ -66,16 +63,6 @@ public class CostStandardVersionServiceImpl extends ServiceImpl queryListResult(String versionNumber) { + QueryWrapper queryWrapper = new QueryWrapper(); + if (StrUtil.isNotEmpty(versionNumber)) { + // 物料号 + queryWrapper.like("version_number", versionNumber); + } + List list = costStandardVersionMapper.selectList(queryWrapper); + return list; + } } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/LatestPurchasePriceServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/LatestPurchasePriceServiceImpl.java deleted file mode 100644 index f361d49..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/LatestPurchasePriceServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service.impl; - - -import com.zzsmart.qomo.kn.cost.manage.entity.LatestPurchasePrice; -import com.zzsmart.qomo.kn.cost.manage.mapper.LatestPurchasePriceMapper; -import com.zzsmart.qomo.kn.cost.manage.service.ILatestPurchasePriceService; -import org.springframework.stereotype.Service; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; - -/** - * @Description: latest_purchase_price - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -@Service -public class LatestPurchasePriceServiceImpl extends ServiceImpl implements ILatestPurchasePriceService { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/ProduceBatchServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/ProduceBatchServiceImpl.java deleted file mode 100644 index 58a66ef..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/ProduceBatchServiceImpl.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service.impl; - - -import com.zzsmart.qomo.kn.cost.manage.entity.ProduceBatch; -import com.zzsmart.qomo.kn.cost.manage.mapper.ProduceBatchMapper; -import com.zzsmart.qomo.kn.cost.manage.service.IProduceBatchService; -import org.springframework.stereotype.Service; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; - -/** - * @Description: produce_batch - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -@Service -public class ProduceBatchServiceImpl extends ServiceImpl implements IProduceBatchService { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/SapSubfactoryServiceImpl.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/SapSubfactoryServiceImpl.java deleted file mode 100644 index e026e6e..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/service/impl/SapSubfactoryServiceImpl.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.service.impl; - -import com.zzsmart.qomo.kn.cost.manage.entity.SapSubfactory; -import com.zzsmart.qomo.kn.cost.manage.mapper.SapSubfactoryMapper; -import com.zzsmart.qomo.kn.cost.manage.service.ISapSubfactoryService; -import org.springframework.stereotype.Service; - -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; - -/** - * @Description: sap_subfactory - * @Author: jeecg-boot - * @Date: 2024-06-11 - * @Version: V1.0 - */ -@Service -public class SapSubfactoryServiceImpl extends ServiceImpl implements ISapSubfactoryService { - -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java index 327111f..fad41e6 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/BomTreeBuilder.java @@ -11,15 +11,17 @@ import java.util.Map; import java.util.stream.Collectors; public class BomTreeBuilder { - public static List buildBomTree(List sourceData) { + public static List buildBomTree(List sourceData, Map parentDataMap) { List result = new ArrayList<>(); - if (sourceData == null || (sourceData != null && sourceData.size() < 1)) { + if ((sourceData == null || (sourceData != null && sourceData.size() < 1)) && (parentDataMap == null || (parentDataMap != null && parentDataMap.size() < 1))) { return result; } //1.把BOM信息分成按照物料号分组 Map materialMap = sourceData.stream().filter(s -> s.getMaterialNumber() != null).collect(Collectors.toMap(CostStandardDetailVO::getMaterialNumber, vo -> vo)); //查找最顶端的父类节点 - Map parentDataMap = sourceData.stream().filter(s -> s.getParentMaterialNumber() == null).collect(Collectors.toMap(CostStandardDetailVO::getMaterialNumber, vo -> vo)); + if (parentDataMap == null || (parentDataMap != null && parentDataMap.size() < 1)) { + parentDataMap = sourceData.stream().filter(s -> s.getParentMaterialNumber() == null).collect(Collectors.toMap(CostStandardDetailVO::getMaterialNumber, vo -> vo)); + } //查找有父节点的子节点 Map> childDataMap = sourceData.stream().filter(s -> s.getParentMaterialNumber() != null).collect(Collectors.groupingBy(CostStandardDetailVO::getParentMaterialNumber)); //查找有父节点的子节点 @@ -52,6 +54,11 @@ public class BomTreeBuilder { if (parentBomTreeInfoVO != null) { //4.根据物料号查找子节点 List childs = childDataMap.get(parentBomTreeInfoVO.getMaterialNumber()); + if (childs != null && childs.size() > 0) { + parentBomTreeInfoVO.setHasChildren(true); + } else { + parentBomTreeInfoVO.setHasChildren(false); + } //构造父节点下的bomtree结构数据 List children = new ArrayList<>(); for (int j = 0; childs != null && childs.size() > 0 && j < childs.size(); j++) { diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/EasyExcelUtil.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/EasyExcelUtil.java new file mode 100644 index 0000000..f774a26 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/util/EasyExcelUtil.java @@ -0,0 +1,135 @@ +package com.zzsmart.qomo.kn.cost.manage.util; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.write.metadata.style.WriteCellStyle; +import com.alibaba.excel.write.metadata.style.WriteFont; +import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; +import com.zzsmart.qomo.kn.cost.manage.entity.CostStandardDetail; +import org.apache.poi.ss.usermodel.*; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Field; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +public class EasyExcelUtil { + /** + * 导出Excel文件到HTTP响应流,包含自定义表头。 + * + * @param response HTTP响应对象 + * @param fileName 导出的文件名 + * @param head 表头信息列表 + * @param data 需要导出的数据列表 + * @param clazz 数据模型的Class类型 + * @throws IOException IO异常 + */ + public static void export(HttpServletResponse response, String fileName, List head, List data, Class clazz) throws IOException { + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.setCharacterEncoding(StandardCharsets.UTF_8.name()); + try { + fileName = URLEncoder.encode(fileName, StandardCharsets.UTF_8.name()).replaceAll("\\+", "%20"); + response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + // 自定义表头样式 + HorizontalCellStyleStrategy horizontalCellStyleStrategy = getHorizontalCellStyleStrategy(); + + // 使用EasyExcel导出 + try { + EasyExcel.write(response.getOutputStream(), clazz) + // 注册样式策略 + .registerWriteHandler(horizontalCellStyleStrategy).sheet("1111").doWrite(data); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } +// FileOutputStream outputStream= new FileOutputStream(fileName); +// try { +// EasyExcel.write(outputStream) +// // 设置自定义样式,可选 +// .sheet("Sheet1") // 设置工作表名称 +// .doWrite(data); // 将数据写入Excel +// } catch (Exception e) { +// e.printStackTrace(); +// System.out.println("zheli=============="); +// } finally { +//// if (excelWriter != null) { +//// excelWriter.finish(); +//// } +// if (outputStream != null) { +// outputStream.close(); +// } + +// } + } + + /** + * 创建自定义的水平单元格样式策略,用于表头样式。 + * + * @return 水平单元格样式策略 + */ + private static HorizontalCellStyleStrategy getHorizontalCellStyleStrategy() { + // 设置表头字体样式 + WriteFont headFont = new WriteFont(); + headFont.setFontHeightInPoints((short) 12); + headFont.setFontName("Arial"); + headFont.setBold(true); + + // 设置表头单元格样式 + WriteCellStyle headCellStyle = new WriteCellStyle(); + headCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); + headCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); + headCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); + headCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND); + headCellStyle.setBorderLeft(BorderStyle.THIN); + headCellStyle.setBorderRight(BorderStyle.THIN); + headCellStyle.setBorderTop(BorderStyle.THIN); + headCellStyle.setBorderBottom(BorderStyle.THIN); + headCellStyle.setWriteFont(headFont); + + // 创建并返回水平单元格样式策略 + return new HorizontalCellStyleStrategy(headCellStyle, (List) null); + } + + /** + * 获取带有@Excel注解的属性集合 + * + * @param clazz 实体类的Class对象 + * @return 带有@Excel注解的Field集合 + */ + public static Field[] getExcelPropertyAnnotatedFields(Class clazz) { + Field[] fields = clazz.getDeclaredFields(); + List annotatedFields = new ArrayList<>(); + + for (Field field : fields) { + if (field.isAnnotationPresent(ExcelProperty.class)) { + annotatedFields.add(field); + } + } + return annotatedFields.toArray(new Field[0]); + } + + /** + * 查询类需要导出的列名 + * + * @param clazz + * @return + */ + public static Set getIncludeFields(Class clazz) { + Field[] excelPropertyAnnotatedFields = getExcelPropertyAnnotatedFields(CostStandardDetail.class); + Set includeColumnFiledNames = new HashSet(); + for (int i = 0; i < excelPropertyAnnotatedFields.length; i++) { + includeColumnFiledNames.add(excelPropertyAnnotatedFields[i].getName()); + } + return includeColumnFiledNames; + } +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/BomTreeInfoVO.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/BomTreeInfoVO.java index 9165bbb..3356e57 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/BomTreeInfoVO.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/BomTreeInfoVO.java @@ -1,14 +1,20 @@ package com.zzsmart.qomo.kn.cost.manage.vo; +import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; +import lombok.NoArgsConstructor; import java.math.BigDecimal; import java.util.List; @Data @Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value="bom结构树", description="bom结构树") public class BomTreeInfoVO { /** * 物料号 @@ -25,6 +31,11 @@ public class BomTreeInfoVO { */ @ApiModelProperty(value = "物料名称") private String materialName; + /** + * 版本号 + */ + @ApiModelProperty(value = "版本号") + private String versionNumber; /** * 数量 */ @@ -126,4 +137,9 @@ public class BomTreeInfoVO { */ @ApiModelProperty(value = "子节点") private List children; + /** + * 是否有叶子节点 + */ + @ApiModelProperty(value = "是否有叶子节点") + private boolean hasChildren; } diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardDetailSearch.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardDetailSearch.java new file mode 100644 index 0000000..30e7812 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardDetailSearch.java @@ -0,0 +1,19 @@ +package com.zzsmart.qomo.kn.cost.manage.vo; + +import io.swagger.annotations.ApiModel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +@Data +@NoArgsConstructor +@AllArgsConstructor +@ApiModel(value = "bom结构树", description = "bom结构树") +public class CostStandardDetailSearch extends CostStandardDetailVO { + /** + * 选择行的id + */ + private List selections; +} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardDetailVO.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardDetailVO.java index 9f322e2..efc6184 100644 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardDetailVO.java +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardDetailVO.java @@ -14,7 +14,7 @@ import java.io.Serializable; * 标准成本明细表 *

* - * @author cost_purchase_price + * @author app_scene_cost_purchase_price * @since 2024-06-19 */ @Data diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardVO.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardVO.java deleted file mode 100644 index 9ef6d09..0000000 --- a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/CostStandardVO.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.zzsmart.qomo.kn.cost.manage.vo; - - -import com.zzsmart.qomo.kn.cost.manage.entity.CostStandard; -import io.swagger.annotations.ApiModelProperty; -import lombok.Data; -import org.jeecgframework.poi.excel.annotation.Excel; - -import java.io.Serializable; - - -/** - * @Classname CostStandardVO - * @Description 标准成本列表出参 - * @Version 1.0.0 - * @Date 2024/6/13 15:51 - * @Created wangqiong - */ -@Data -public class CostStandardVO extends CostStandard implements Serializable { - private static final long serialVersionUID = 1L; - /**年份*/ - @ApiModelProperty(value = "年份") - private String versionYear; - /**版本状态*/ - @ApiModelProperty(value = "版本状态") - private String versionStatus; - /**阶段,A-初始,B-首批,C-量产*/ - @ApiModelProperty(value = "阶段") - private String stage; - /**版本号*/ - @ApiModelProperty(value = "版本号") - private String versionNumber; -} diff --git a/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/FlowTaskInfoVO.java b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/FlowTaskInfoVO.java new file mode 100644 index 0000000..7da21a4 --- /dev/null +++ b/qomo-kn-cost-manage/src/main/java/com/zzsmart/qomo/kn/cost/manage/vo/FlowTaskInfoVO.java @@ -0,0 +1,37 @@ +package com.zzsmart.qomo.kn.cost.manage.vo; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class FlowTaskInfoVO { + /** + * 最顶层物料编号 + */ + private String topMaterialCode; + /** + * 获取任务类型 + */ + private String taskType; + /** + * 获取任务代码 + */ + private String taskCode; + /** + * 获取流程id + */ + private String flowInstanceId; + /** + * SQL查询语句 + */ + private String sqlString; + /** + * 费用类别 + */ + private String feeType; +} diff --git a/qomo-kn-cost-manage/src/test/java/com/zzsmart/qomo/kn/cost/manage/ApplicationTests.java b/qomo-kn-cost-manage/src/test/java/com/zzsmart/qomo/kn/cost/manage/ApplicationTests.java index 55265ec..b02a8a0 100644 --- a/qomo-kn-cost-manage/src/test/java/com/zzsmart/qomo/kn/cost/manage/ApplicationTests.java +++ b/qomo-kn-cost-manage/src/test/java/com/zzsmart/qomo/kn/cost/manage/ApplicationTests.java @@ -1,78 +1,67 @@ package com.zzsmart.qomo.kn.cost.manage; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.generator.FastAutoGenerator; -import com.baomidou.mybatisplus.generator.config.OutputFile; -import com.baomidou.mybatisplus.generator.config.TemplateType; -import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; -import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine; -import org.junit.Test; -import org.springframework.boot.test.context.SpringBootTest; - -import java.util.Collections; - -@SpringBootTest +//@SpringBootTest public class ApplicationTests { /** * 根据表名生成相应结构代码 -// * @param databaseName 数据库名 -// * @param tableName 表名 + // * @param databaseName 数据库名 + // * @param tableName 表名 */ - @Test - public void Generation(){ - FastAutoGenerator.create("jdbc:mysql://121.40.189.20:3306/"+"knne"+"?&useSSL=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai","root","YMzc157#") - .globalConfig(builder -> { - builder.author(" ") - .fileOverride()//是否覆盖 - //启用swagger - //.enableSwagger() - //指定输出目录 - .outputDir(System.getProperty("user.dir")+"/src/main/java"); - }) - .packageConfig(builder -> { - builder.entity("entity")//实体类包名 - .parent("com.zzsmart.qomo.kn.cost.manage")//父包名。如果为空,将下面子包名必须写全部, 否则就只需写子包名 - .controller("controller")//控制层包名 - .mapper("mapper")//mapper层包名 - //.other("dto")//生成dto目录 可不用 - .service("service")//service层包名 - .serviceImpl("service.impl")//service实现类包名 - //自定义mapper.xml文件输出目录 - .pathInfo(Collections.singletonMap(OutputFile.mapperXml,System.getProperty("user.dir")+"/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml")); - }) - .strategyConfig(builder -> { - builder.addInclude("cost_standard_detail")// todo 设置需要生成的表名 - //.addTablePrefix("sys_")//设置表前缀过滤 - .entityBuilder() - .enableLombok() - .enableChainModel() - .naming(NamingStrategy.underline_to_camel)//数据表映射实体命名策略:默认下划线转驼峰underline_to_camel - .columnNaming(NamingStrategy.underline_to_camel)//表字段映射实体属性命名规则:默认null,不指定按照naming执行 - .idType(IdType.AUTO)//添加全局主键类型 - .formatFileName("%s")//格式化实体名称,%s取消首字母I, - .enableTableFieldAnnotation() - .enableColumnConstant() - .mapperBuilder() - .enableMapperAnnotation()//开启mapper注解 - .enableBaseResultMap()//启用xml文件中的BaseResultMap 生成 - .enableBaseColumnList()//启用xml文件中的BaseColumnList - .formatMapperFileName("%sMapper")//格式化Dao类名称 - .formatXmlFileName("%sMapper")//格式化xml文件名称 - .serviceBuilder() - .formatServiceFileName("%sService")//格式化 service 接口文件名称 - .formatServiceImplFileName("%sServiceImpl")//格式化 service 接口文件名称 - .controllerBuilder() - .enableRestStyle(); - }) - // 使用Freemarker引擎模板,默认的是Velocity引擎模板 - .templateConfig(builder -> { - builder.disable(TemplateType.CONTROLLER) - .disable(TemplateType.SERVICE) - .disable(TemplateType.SERVICEIMPL); - }) - .templateEngine(new FreemarkerTemplateEngine()) - .execute(); - - } +// @Test +// public void Generation(){ +// FastAutoGenerator.create("jdbc:mysql://121.40.189.20:3306/"+"knne"+"?&useSSL=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai","root","YMzc157#") +// .globalConfig(builder -> { +// builder.author(" ") +// .fileOverride()//是否覆盖 +// //启用swagger +// //.enableSwagger() +// //指定输出目录 +// .outputDir(System.getProperty("user.dir")+"/src/main/java"); +// }) +// .packageConfig(builder -> { +// builder.entity("entity")//实体类包名 +// .parent("com.zzsmart.qomo.kn.cost.manage")//父包名。如果为空,将下面子包名必须写全部, 否则就只需写子包名 +// .controller("controller")//控制层包名 +// .mapper("mapper")//mapper层包名 +// //.other("dto")//生成dto目录 可不用 +// .service("service")//service层包名 +// .serviceImpl("service.impl")//service实现类包名 +// //自定义mapper.xml文件输出目录 +// .pathInfo(Collections.singletonMap(OutputFile.mapperXml,System.getProperty("user.dir")+"/src/main/java/com/zzsmart/qomo/kn/cost/manage/mapper/xml")); +// }) +// .strategyConfig(builder -> { +// builder.addInclude("app_scene_cost_model")// todo 设置需要生成的表名 +// //.addTablePrefix("sys_")//设置表前缀过滤 +// .entityBuilder() +// .enableLombok() +// .enableChainModel() +// .naming(NamingStrategy.underline_to_camel)//数据表映射实体命名策略:默认下划线转驼峰underline_to_camel +// .columnNaming(NamingStrategy.underline_to_camel)//表字段映射实体属性命名规则:默认null,不指定按照naming执行 +// .idType(IdType.AUTO)//添加全局主键类型 +// .formatFileName("%s")//格式化实体名称,%s取消首字母I, +// .enableTableFieldAnnotation() +// .enableColumnConstant() +// .mapperBuilder() +// .enableMapperAnnotation()//开启mapper注解 +// .enableBaseResultMap()//启用xml文件中的BaseResultMap 生成 +// .enableBaseColumnList()//启用xml文件中的BaseColumnList +// .formatMapperFileName("%sMapper")//格式化Dao类名称 +// .formatXmlFileName("%sMapper")//格式化xml文件名称 +// .serviceBuilder() +// .formatServiceFileName("%sService")//格式化 service 接口文件名称 +// .formatServiceImplFileName("%sServiceImpl")//格式化 service 接口文件名称 +// .controllerBuilder() +// .enableRestStyle(); +// }) +// // 使用Freemarker引擎模板,默认的是Velocity引擎模板 +//// .templateConfig(builder -> { +//// builder.disable(TemplateType.CONTROLLER) +//// .disable(TemplateType.SERVICE) +//// .disable(TemplateType.SERVICEIMPL); +//// }) +// .templateEngine(new FreemarkerTemplateEngine()) +// .execute(); +// +// } }