Merge branch 'bgy' of kn-cost/cost-backend into dev

This commit was merged in pull request #11.
This commit is contained in:
bgy
2024-07-29 18:07:32 +08:00
committed by Gitea
120 changed files with 3886 additions and 2761 deletions
+56 -12
View File
@@ -1,12 +1,17 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-kn-forecast</artifactId>
<version>${revision}</version>
<packaging>pom</packaging>
<name>QOMO FORECAST</name>
<name>QOMO Cost Manage</name>
<modules>
<module>qomo-kn-cost-manage-start</module>
<module>qomo-kn-cost-manage</module>
</modules>
<developers>
<developer>
<name>武汉中制智造</name>
@@ -24,13 +29,8 @@
<properties>
<revision>2.0.0-SNAPSHOT</revision>
<adp.version>2.0.0-SNAPSHOT</adp.version>
<dmp.version>2.0.0-SNAPSHOT</dmp.version>
</properties>
<modules>
<module>qomo-kn-cost-manage-start</module>
<module>qomo-kn-cost-manage</module>
</modules>
<repositories>
<repository>
<id>zzzz</id>
@@ -98,9 +98,53 @@
<artifactId>qomo-kn-cost-manage</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-data-model</artifactId>
<version>${dmp.version}</version>
</dependency>
<dependency>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-assets-management</artifactId>
<version>${dmp.version}</version>
</dependency>
<dependency>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-data-integration</artifactId>
<version>${dmp.version}</version>
</dependency>
<dependency>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-data-metadata</artifactId>
<version>${dmp.version}</version>
</dependency>
<dependency>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-work-flow</artifactId>
<version>${dmp.version}</version>
</dependency>
<dependency>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-data-warehouse</artifactId>
<version>${dmp.version}</version>
</dependency>
<dependency>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-data-selfReport</artifactId>
<version>${dmp.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>commons-io</groupId>-->
<!-- <artifactId>commons-io</artifactId>-->
<!-- <version>2.11.0</version>-->
<!-- </dependency>-->
</dependencies>
</dependencyManagement>
<!-- 环境 -->
<profiles>
<!-- 开发 -->
@@ -175,4 +219,4 @@
</profile>
<!-- SpringCloud运行环境 -->
</profiles>
</project>
</project>
+49 -2
View File
@@ -2,13 +2,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-kn-forecast</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>qomo-kn-cost-manage-start</artifactId>
<properties>
@@ -52,4 +51,52 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>dmp</id>
<activation>
<!--默认激活配置-->
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<profile.name>dmp</profile.name>
</properties>
<dependencies>
<dependency>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-data-model</artifactId>
</dependency>
<dependency>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-assets-management</artifactId>
</dependency>
<dependency>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-data-integration</artifactId>
</dependency>
<dependency>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-data-metadata</artifactId>
</dependency>
<dependency>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-work-flow</artifactId>
</dependency>
<dependency>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-data-warehouse</artifactId>
</dependency>
<dependency>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-data-selfReport</artifactId>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
@@ -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 {
@@ -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
tikaServerUrl: http://192.168.50.99:8099/qomo-tika/
+38 -20
View File
@@ -2,42 +2,60 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-kn-forecast</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>qomo-kn-cost-manage</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.qomo.boot</groupId>
<artifactId>qomo-system-biz</artifactId>
<version>2.0.1-SNAPSHOT</version>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<scope>test</scope>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
<version>3.5.1</version>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-data-integration</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.3</version>
</dependency>
<!--自己添加的依赖-->
<!-- <dependency>-->
<!-- <groupId>commons-io</groupId>-->
<!-- <artifactId>commons-io</artifactId>-->
<!-- <version>2.11.0</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>4.0.1</version> <!-- 请检查并使用最新稳定版本 -->
</dependency>
</dependencies>
</dependencies>
</project>
@@ -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<AppSceneCostCount, IAppSceneCostCountService> {
@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<IPage<AppSceneCostCount>> queryPageList(AppSceneCostCount appSceneCostCount,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AppSceneCostCount> queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostCount, req.getParameterMap());
Page<AppSceneCostCount> page = new Page<AppSceneCostCount>(pageNo, pageSize);
IPage<AppSceneCostCount> 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<String> 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<String> 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<String> 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<AppSceneCostCount> 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<AppSceneCostCount> 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);
}
}
@@ -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<IPage<FlowDefinition>> queryPageList(FlowDefinition flowDefinition, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
QueryWrapper<FlowDefinition> queryWrapper = QueryGenerator.initQueryWrapper(flowDefinition, req.getParameterMap());
Page<FlowDefinition> page = new Page((long) pageNo, (long) pageSize);
LambdaQueryWrapper<FlowDefinition> wrapper = queryWrapper.lambda();
wrapper.orderByDesc(FlowDefinition::getCreateTime);
IPage<FlowDefinition> pageList = flowDefinitionService.queryPageList(page, wrapper);
return Result.OK(pageList);
}
@ApiOperation(value = "标准成本模型列表", notes = "标准成本模型列表")
@GetMapping(value = "/list")
public Result<List<FlowDefinition>> queryList(FlowDefinition flowDefinition, HttpServletRequest req) {
QueryWrapper<FlowDefinition> queryWrapper = QueryGenerator.initQueryWrapper(flowDefinition, req.getParameterMap());
LambdaQueryWrapper<FlowDefinition> wrapper = queryWrapper.lambda();
wrapper.orderByDesc(FlowDefinition::getCreateTime);
List<FlowDefinition> 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<FlowDefinition> 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<FlowDefinition> 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<String> delete(@RequestParam(name = "id", required = true) Integer id) {
flowDefinitionService.delete(id);
return Result.OK("删除成功!");
}
}
@@ -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<AppSceneCostResultValue, IAppSceneCostResultValueService> {
@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<IPage<AppSceneCostResultValue>> queryPageList(AppSceneCostResultValue appSceneCostResultValue,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AppSceneCostResultValue> queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostResultValue, req.getParameterMap());
Page<AppSceneCostResultValue> page = new Page<AppSceneCostResultValue>(pageNo, pageSize);
IPage<AppSceneCostResultValue> 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<String> 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<String> 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<String> 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<String> 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<AppSceneCostResultValue> 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);
}
}
@@ -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<List<BomTreeInfoVO>> queryBomTree(@RequestParam(name = "materialNumber", required = false) String materialNumber, @RequestParam(name = "versionNumber", required = false) String versionNumber) {
List<BomTreeInfoVO> bomTreeInfoVOS = bomTreeService.getBomTreeByMaterialNumber(materialNumber, versionNumber);
return Result.OK(bomTreeInfoVOS);
}
@@ -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<BudgetPrice, IBudgetPriceService> {
@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<IPage<BudgetPrice>> queryPageList(BudgetPrice budgetPrice,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<BudgetPrice> queryWrapper = QueryGenerator.initQueryWrapper(budgetPrice, req.getParameterMap());
Page<BudgetPrice> page = new Page<BudgetPrice>(pageNo, pageSize);
IPage<BudgetPrice> 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<String> 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<String> 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<String> 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<String> 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<BudgetPrice> 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);
}
}
@@ -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<C7525cost, IC7525costService> {
@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<IPage<C7525cost>> queryPageList(C7525cost c7525cost,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<C7525cost> queryWrapper = QueryGenerator.initQueryWrapper(c7525cost, req.getParameterMap());
Page<C7525cost> page = new Page<C7525cost>(pageNo, pageSize);
IPage<C7525cost> 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<String> 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<String> 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<String> 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<String> 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<C7525cost> 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);
}
}
@@ -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<CostCenter, ICostCenterService> {
@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<IPage<CostCenter>> queryPageList(CostCenter costCenter,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<CostCenter> queryWrapper = QueryGenerator.initQueryWrapper(costCenter, req.getParameterMap());
Page<CostCenter> page = new Page<CostCenter>(pageNo, pageSize);
IPage<CostCenter> 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<String> 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<String> 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<String> 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<String> 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<CostCenter> 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);
}
}
@@ -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;
/**
* <p>
* 物料bom 前端控制器
* </p>
*
* @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<IPage<CostMaterialBom>> queryPageList(CostMaterialBom costMaterialBom,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<CostMaterialBom> queryWrapper = QueryGenerator.initQueryWrapper(costMaterialBom, req.getParameterMap());
Page<CostMaterialBom> page = new Page<CostMaterialBom>(pageNo, pageSize);
IPage<CostMaterialBom> pageList = costMaterialBomService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 列表查询
*
* @return
*/
@ApiOperation(value="物料bom列表查询", notes="物料bom列表查询")
@GetMapping(value = "/list")
public Result< List<CostMaterialBom>> queryList(@RequestParam(name = "materialNumber",required = false) String materialNumber) {
List<CostMaterialBom> list = costMaterialBomService.queryListResult(materialNumber);
return Result.OK(list);
}
}
@@ -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<CostPartMissi
* @param req
* @return
*/
//@AutoLog(value = "cost_part_missing_info-分页列表查询")
@ApiOperation(value="cost_part_missing_info-分页列表查询", notes="cost_part_missing_info-分页列表查询")
//@AutoLog(value = "app_scene_cost_part_missing_info-分页列表查询")
@ApiOperation(value="app_scene_cost_part_missing_info-分页列表查询", notes="app_scene_cost_part_missing_info-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<CostPartMissingInfo>> queryPageList(CostPartMissingInfo costPartMissingInfo,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@@ -80,9 +80,9 @@ public class CostPartMissingInfoController extends JeecgController<CostPartMissi
* @param costPartMissingInfo
* @return
*/
@AutoLog(value = "cost_part_missing_info-添加")
@ApiOperation(value="cost_part_missing_info-添加", notes="cost_part_missing_info-添加")
// @RequiresPermissions(":cost_part_missing_info:add")
@AutoLog(value = "app_scene_cost_part_missing_info-添加")
@ApiOperation(value="app_scene_cost_part_missing_info-添加", notes="app_scene_cost_part_missing_info-添加")
// @RequiresPermissions(":app_scene_cost_part_missing_info:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody CostPartMissingInfo costPartMissingInfo) {
costPartMissingInfoService.save(costPartMissingInfo);
@@ -95,9 +95,9 @@ public class CostPartMissingInfoController extends JeecgController<CostPartMissi
* @param costPartMissingInfo
* @return
*/
@AutoLog(value = "cost_part_missing_info-编辑")
@ApiOperation(value="cost_part_missing_info-编辑", notes="cost_part_missing_info-编辑")
// @RequiresPermissions(":cost_part_missing_info:edit")
@AutoLog(value = "app_scene_cost_part_missing_info-编辑")
@ApiOperation(value="app_scene_cost_part_missing_info-编辑", notes="app_scene_cost_part_missing_info-编辑")
// @RequiresPermissions(":app_scene_cost_part_missing_info:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody CostPartMissingInfo costPartMissingInfo) {
costPartMissingInfoService.updateById(costPartMissingInfo);
@@ -110,9 +110,9 @@ public class CostPartMissingInfoController extends JeecgController<CostPartMissi
* @param id
* @return
*/
@AutoLog(value = "cost_part_missing_info-通过id删除")
@ApiOperation(value="cost_part_missing_info-通过id删除", notes="cost_part_missing_info-通过id删除")
// @RequiresPermissions(":cost_part_missing_info:delete")
@AutoLog(value = "app_scene_cost_part_missing_info-通过id删除")
@ApiOperation(value="app_scene_cost_part_missing_info-通过id删除", notes="app_scene_cost_part_missing_info-通过id删除")
// @RequiresPermissions(":app_scene_cost_part_missing_info:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
costPartMissingInfoService.removeById(id);
@@ -125,9 +125,9 @@ public class CostPartMissingInfoController extends JeecgController<CostPartMissi
* @param ids
* @return
*/
@AutoLog(value = "cost_part_missing_info-批量删除")
@ApiOperation(value="cost_part_missing_info-批量删除", notes="cost_part_missing_info-批量删除")
// @RequiresPermissions(":cost_part_missing_info:deleteBatch")
@AutoLog(value = "app_scene_cost_part_missing_info-批量删除")
@ApiOperation(value="app_scene_cost_part_missing_info-批量删除", notes="app_scene_cost_part_missing_info-批量删除")
// @RequiresPermissions(":app_scene_cost_part_missing_info:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.costPartMissingInfoService.removeByIds(Arrays.asList(ids.split(",")));
@@ -140,8 +140,8 @@ public class CostPartMissingInfoController extends JeecgController<CostPartMissi
* @param id
* @return
*/
//@AutoLog(value = "cost_part_missing_info-通过id查询")
@ApiOperation(value="cost_part_missing_info-通过id查询", notes="cost_part_missing_info-通过id查询")
//@AutoLog(value = "app_scene_cost_part_missing_info-通过id查询")
@ApiOperation(value="app_scene_cost_part_missing_info-通过id查询", notes="app_scene_cost_part_missing_info-通过id查询")
@GetMapping(value = "/queryById")
public Result<CostPartMissingInfo> queryById(@RequestParam(name="id",required=true) String id) {
CostPartMissingInfo costPartMissingInfo = costPartMissingInfoService.getById(id);
@@ -157,10 +157,10 @@ public class CostPartMissingInfoController extends JeecgController<CostPartMissi
* @param request
* @param costPartMissingInfo
*/
// @RequiresPermissions(":cost_part_missing_info:exportXls")
// @RequiresPermissions(":app_scene_cost_part_missing_info:exportXls")
@RequestMapping(value = "/exportXls",method = RequestMethod.GET)
public ModelAndView exportXls(HttpServletRequest request, CostPartMissingInfo costPartMissingInfo) {
return super.exportXls(request, costPartMissingInfo, CostPartMissingInfo.class, "cost_part_missing_info");
return super.exportXls(request, costPartMissingInfo, CostPartMissingInfo.class, "app_scene_cost_part_missing_info");
}
/**
@@ -170,7 +170,7 @@ public class CostPartMissingInfoController extends JeecgController<CostPartMissi
* @param response
* @return
*/
// @RequiresPermissions(":cost_part_missing_info:importExcel")
// @RequiresPermissions(":app_scene_cost_part_missing_info:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, CostPartMissingInfo.class);
@@ -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<CostStandard, ICostStandardService> {
@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<IPage<CostStandardVO>> queryPageList(CostStandardVO costStandard,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Page<CostStandardVO> page = new Page<CostStandardVO>(pageNo, pageSize);
IPage<CostStandardVO> 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<String> 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<String> 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<String> 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<String> 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<CostStandard> 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();
}
}
@@ -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;
/**
* <p>
* 标准成本明细表 前端控制器
* </p>
*
* @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<CostStandardDetail, CostStandardDetailService> {
@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<IPage<CostStandardDetailVO>> queryPageList(CostStandardDetailVO costStandard,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
public Result<IPage<CostStandardDetailVO>> queryPageList(CostStandardDetailVO costStandard, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
Page<CostStandardDetailVO> page = new Page<CostStandardDetailVO>(pageNo, pageSize);
IPage<CostStandardDetailVO> 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);
}
}
@@ -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<CostStandardV
* @param req
* @return
*/
//@AutoLog(value = "cost_standard_version-分页列表查询")
@ApiOperation(value="cost_standard_version-分页列表查询", notes="cost_standard_version-分页列表查询")
@GetMapping(value = "/list")
//@AutoLog(value = "app_scene_cost_standard_version-分页列表查询")
@ApiOperation(value="app_scene_cost_standard_version-分页列表查询", notes="app_scene_cost_standard_version-分页列表查询")
@GetMapping(value = "/pageList")
public Result<IPage<CostStandardVersion>> 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<CostStandardV
IPage<CostStandardVersion> pageList = costStandardVersionService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 列表查询
*
* @return
*/
@ApiOperation(value="版本号列表查询", notes="版本号列表查询")
@GetMapping(value = "/list")
public Result< List<CostStandardVersion>> queryList(@RequestParam(name = "versionNumber",required = false) String versionNumber) {
List<CostStandardVersion> 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<String> add(@RequestBody CostStandardVersion costStandardVersion) {
boolean save = costStandardVersionService.save(costStandardVersion);
@@ -101,9 +94,9 @@ public class CostStandardVersionController extends JeecgController<CostStandardV
* @param costStandardVersion
* @return
*/
@AutoLog(value = "cost_standard_version-编辑")
@ApiOperation(value="cost_standard_version-编辑", notes="cost_standard_version-编辑")
// @RequiresPermissions(":cost_standard_version:edit")
@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:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody CostStandardVersion costStandardVersion) {
costStandardVersionService.updateById(costStandardVersion);
@@ -116,9 +109,9 @@ public class CostStandardVersionController extends JeecgController<CostStandardV
* @param id
* @return
*/
@AutoLog(value = "cost_standard_version-通过id删除")
@ApiOperation(value="cost_standard_version-通过id删除", notes="cost_standard_version-通过id删除")
// @RequiresPermissions(":cost_standard_version:delete")
@AutoLog(value = "app_scene_cost_standard_version-通过id删除")
@ApiOperation(value="app_scene_cost_standard_version-通过id删除", notes="app_scene_cost_standard_version-通过id删除")
// @RequiresPermissions(":app_scene_cost_standard_version:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
costStandardVersionService.removeById(id);
@@ -131,9 +124,9 @@ public class CostStandardVersionController extends JeecgController<CostStandardV
* @param ids
* @return
*/
@AutoLog(value = "cost_standard_version-批量删除")
@ApiOperation(value="cost_standard_version-批量删除", notes="cost_standard_version-批量删除")
// @RequiresPermissions(":cost_standard_version:deleteBatch")
@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:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.costStandardVersionService.removeByIds(Arrays.asList(ids.split(",")));
@@ -146,8 +139,8 @@ public class CostStandardVersionController extends JeecgController<CostStandardV
* @param id
* @return
*/
//@AutoLog(value = "cost_standard_version-通过id查询")
@ApiOperation(value="cost_standard_version-通过id查询", notes="cost_standard_version-通过id查询")
//@AutoLog(value = "app_scene_cost_standard_version-通过id查询")
@ApiOperation(value="app_scene_cost_standard_version-通过id查询", notes="app_scene_cost_standard_version-通过id查询")
@GetMapping(value = "/queryById")
public Result<CostStandardVersion> queryById(@RequestParam(name="id",required=true) String id) {
CostStandardVersion costStandardVersion = costStandardVersionService.getById(id);
@@ -163,10 +156,10 @@ public class CostStandardVersionController extends JeecgController<CostStandardV
* @param request
* @param costStandardVersion
*/
// @RequiresPermissions(":cost_standard_version:exportXls")
// @RequiresPermissions(":app_scene_cost_standard_version:exportXls")
@RequestMapping(value = "/exportXls", method = RequestMethod.GET)
public ModelAndView exportXls(HttpServletRequest request, CostStandardVersion costStandardVersion) {
return super.exportXls(request, costStandardVersion, CostStandardVersion.class, "cost_standard_version");
return super.exportXls(request, costStandardVersion, CostStandardVersion.class, "app_scene_cost_standard_version");
}
/**
@@ -176,7 +169,7 @@ public class CostStandardVersionController extends JeecgController<CostStandardV
* @param response
* @return
*/
// @RequiresPermissions(":cost_standard_version:importExcel")
// @RequiresPermissions(":app_scene_cost_standard_version:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return this.costStandardVersionService.importExcel(request, response, CostStandardVersion.class);
@@ -27,7 +27,7 @@ import java.util.Arrays;
* @Date: 2024-06-06
* @Version: V1.0
*/
@Api(tags="小时费率")
@Api(tags="cost-小时费率")
@RestController
@RequestMapping("//hourRate")
@Slf4j
@@ -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<LatestPurchasePrice, ILatestPurchasePriceService> {
@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<IPage<LatestPurchasePrice>> queryPageList(LatestPurchasePrice latestPurchasePrice,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<LatestPurchasePrice> queryWrapper = QueryGenerator.initQueryWrapper(latestPurchasePrice, req.getParameterMap());
Page<LatestPurchasePrice> page = new Page<LatestPurchasePrice>(pageNo, pageSize);
IPage<LatestPurchasePrice> 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<String> 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<String> 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<String> 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<String> 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<LatestPurchasePrice> 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);
}
}
@@ -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<ProduceBatch, IProduceBatchService> {
@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<IPage<ProduceBatch>> queryPageList(ProduceBatch produceBatch,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ProduceBatch> queryWrapper = QueryGenerator.initQueryWrapper(produceBatch, req.getParameterMap());
Page<ProduceBatch> page = new Page<ProduceBatch>(pageNo, pageSize);
IPage<ProduceBatch> 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<String> 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<String> 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<String> 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<String> 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<ProduceBatch> 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);
}
}
@@ -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<SapSubfactory, ISapSubfactoryService> {
@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<IPage<SapSubfactory>> queryPageList(SapSubfactory sapSubfactory,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<SapSubfactory> queryWrapper = QueryGenerator.initQueryWrapper(sapSubfactory, req.getParameterMap());
Page<SapSubfactory> page = new Page<SapSubfactory>(pageNo, pageSize);
IPage<SapSubfactory> 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<String> 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<String> 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<String> 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<String> 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<SapSubfactory> 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);
}
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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
* </p>
*
* @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;
@@ -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;
@@ -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;
/**
* <p>
*
* </p>
*
* @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";
}
@@ -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;
@@ -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;
@@ -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;
}
@@ -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;
/**
* <p>
* 标准成本明细表
* </p>
*
* @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;
}
@@ -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;
}
@@ -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")
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
}
@@ -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();
}
}
@@ -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<AppSceneCostCount> {
}
@@ -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<AppSceneCostModel> {
}
@@ -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<AppSceneCostResultValue> {
}
@@ -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<BudgetPrice> {
}
@@ -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<C7525cost> {
}
@@ -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<CostCenter> {
}
@@ -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;
/**
* <p>
* 物料bom Mapper 接口
* </p>
*
* @author
* @since 2024-06-19
* @author
* @since 2024-06-21
*/
@Mapper
public interface CostMaterialBomMapper extends BaseMapper<CostMaterialBom> {
/**
* 根据动态SQL语句查询物料BOM表
*
* @param selectCommand
* @return
*/
@Select("${selectCommand}")
List<CostMaterialBom> customSelect(@Param("selectCommand") String selectCommand);
@Select("${selectSql}")
JSONObject customSelectOne(@Param("selectSql") String selectSql);
@Select("${SelectBlobModel}")
String customSelectBlobModelJson(@Param("SelectBlobModel") String SelectBlobModel);
}
@@ -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<CostStandard> {
IPage<CostStandardVO> pageList(@Param("page")Page<CostStandardVO> page , @Param(Constants.WRAPPER) Wrapper<CostStandardVO> wrapper);
}
@@ -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<LatestPurchasePrice> {
}
@@ -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<ProduceBatch> {
}
@@ -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<SapSubfactory> {
}
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.ProduceBatchMapper">
<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostCountMapper">
</mapper>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.CostCenterMapper">
<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostModelMapper">
</mapper>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.LatestPurchasePriceMapper">
<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostResultValueMapper">
</mapper>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.BudgetPriceMapper">
</mapper>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.C7525costMapper">
</mapper>
@@ -40,8 +40,8 @@
<select id="pageList" resultMap="CostStandardDetailVOResultMap">
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
@@ -49,8 +49,8 @@
<select id="queryListResult" resultMap="CostStandardDetailVOResultMap">
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
@@ -1,42 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.CostStandardMapper">
<resultMap id="CostStandardVOResultMap" type="com.zzsmart.qomo.kn.cost.manage.vo.CostStandardVO" >
<result column="id" property="id" />
<result column="material_number" property="materialNumber" />
<result column="version_number" property="versionNumber" />
<result column="version_number_id" property="versionNumberId" />
<result column="bom_cost" property="bomCost" />
<result column="packing_cost" property="packingCost" />
<result column="auxiliary_cost" property="auxiliaryCost" />
<result column="labor_cost" property="laborCost" />
<result column="euip_depreciation_cost" property="euipDepreciationCost" />
<result column="equip_consume_cost" property="equipConsumeCost" />
<result column="hydroelectricity_cost" property="hydroelectricityCost" />
<result column="other_cost" property="otherCost" />
<result column="trail_cost" property="trailCost" />
<result column="manufacture_cost" property="manufactureCost" />
<result column="tooling_cost" property="toolingCost" />
<result column="Inspection_cost" property="inspectionCost" />
<result column="mold_cost" property="moldCost" />
<result column="test_cost" property="testCost" />
<result column="total_cost" property="totalCost" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="remark" property="remark" />
<result column="version_status" property="versionStatus" />
<result column="stage" property="stage" />
<result column="version_year" property="versionYear" />
</resultMap>
<select id="pageList" resultMap="CostStandardVOResultMap">
select c1.*, c2.version_number, c2.version_status, c2.stage,c2.version_year
from
cost_standard c1
left join cost_standard_version c2 on c1.version_number_id = c2.id
${ew.customSqlSegment}
ORDER BY c1.create_time desc
</select>
</mapper>
@@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zzsmart.qomo.kn.cost.manage.mapper.SapSubfactoryMapper">
</mapper>
@@ -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<CostMaterialBom> 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<AppSceneCostResultValue> list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", flowInstanceId);
//2.计算出所有的单个物料的物料成本
//2.1查询出物料的单价和采购数量
List<String> MarterialNoList = new ArrayList<>();
if (list != null && list.size() > 0) {
MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList());
}
//查询物料的采购价
Map<String, BigDecimal> 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<AppSceneCostResultValue> list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", flowInstanceId);
//2.计算出所有的单个物料的人工成本
//2.1查询出物料的人员工时和人工小时费率(涉及:小时费率表和工序表)
List<String> MarterialNoList = new ArrayList<>();
if (list != null && list.size() > 0) {
MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList());
}
//查询工序工时
Map<String, List<CostMaterialProcessHours>> 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> 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<AppSceneCostResultValue> list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "MaterialInput", flowInstanceId);
//2.根据费用类型进行不同的费用计算
//查询工序工时
List<String> MarterialNoList = new ArrayList<>();
if (list != null && list.size() > 0) {
MarterialNoList = list.stream().filter(s -> s.getMarterialNo() != null).map(AppSceneCostResultValue::getMarterialNo).collect(Collectors.toList());
}
Map<String, List<CostMaterialProcessHours>> 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> 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> 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> 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> 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<String, List<AppSceneCostResultValue>> materialNoMap = list.stream().collect(Collectors.groupingBy(AppSceneCostResultValue::getMarterialNo));
for (String key : materialNoMap.keySet()) {
List<AppSceneCostResultValue> 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<AppSceneCostResultValue> list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, null, flowInstanceId);
//2.计算出所有的单个物料的本阶的标准成本(标准成本=物料成本+人工成本+制造费用)
//按照物料编号进行分组
Map<String, List<AppSceneCostResultValue>> materialNoMap = list.stream().collect(Collectors.groupingBy(AppSceneCostResultValue::getMarterialNo));
for (String key : materialNoMap.keySet()) {
List<AppSceneCostResultValue> 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<AppSceneCostResultValue> 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<AppSceneCostResultValue> standardCostList, String topMaterialCode, String taskType, String taskCode, String flowInstanceId) {
Map<String, List<AppSceneCostResultValue>> 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<String, List<AppSceneCostResultValue>> parentMaterialNoMap, String topMaterialCode, String taskType, String taskCode, String flowInstanceId, BigDecimal totalCost) {
String marterialNo = appSceneCostResultValue.getMarterialNo();
if (parentMaterialNoMap.containsKey(marterialNo)) {
List<AppSceneCostResultValue> 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;
}
}
@@ -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<ResourceInfo> getResourceFilesList() {
return new ArrayList<>();
}
@Override
public void dealOutParam(String result) {
}
@Override
public String toString() {
return getLocalParams().toString();
// return "人工成本任务";
}
}
@@ -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 {
}
}
@@ -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();
}
}
@@ -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<PluginParams> getParams() {
return null;
}
@Override
public TaskChannel create() {
return new LaborCostTaskChannel();
}
}
@@ -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<ResourceInfo> getResourceFilesList() {
return new ArrayList<>();
}
@Override
public void dealOutParam(String result) {
}
@Override
public String toString() {
return "制造费用成本任务";
}
}
@@ -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 {
}
}
@@ -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();
}
}
@@ -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<PluginParams> getParams() {
return null;
}
@Override
public TaskChannel create() {
return new ManufacturingCostTaskChannel();
}
}
@@ -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<ResourceInfo> getResourceFilesList() {
return new ArrayList<>();
}
@Override
public void dealOutParam(String result) {
}
@Override
public String toString() {
return "物料成本任务";
}
}
@@ -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 {
}
}
@@ -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();
}
}
@@ -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<PluginParams> getParams() {
return null;
}
@Override
public TaskChannel create() {
return new MaterialCostTaskChannel();
}
}
@@ -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<ResourceInfo> getResourceFilesList() {
return new ArrayList<>();
}
@Override
public void dealOutParam(String result) {
}
@Override
public String toString() {
return "物料编号输入任务";
}
}
@@ -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 {
}
}
@@ -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();
}
}
@@ -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<PluginParams> getParams() {
return null;
}
@Override
public TaskChannel create() {
return new MaterialInputTaskChannel();
}
}
@@ -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<ResourceInfo> getResourceFilesList() {
return new ArrayList<>();
}
@Override
public void dealOutParam(String result) {
}
@Override
public String toString() {
return "标准成本计算任务";
}
}
@@ -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 {
}
}
@@ -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();
}
}
@@ -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<PluginParams> getParams() {
return null;
}
@Override
public TaskChannel create() {
return new StandardCostTaskChannel();
}
}
@@ -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;
/**
* <p>
* 物料bom 服务类
* </p>
*
* @author
* @since 2024-06-19
* @author
* @since 2024-06-21
*/
public interface CostMaterialBomService extends IService<CostMaterialBom> {
/**
* 分页查询
* @param
* @return
*/
List<CostMaterialBom> queryListResult(String materialNumber);
/**
* 查询最顶层物料编号下所有的物料
* @param topMaterialCode
* @return
*/
List<CostMaterialBom> queryAllBomInfoBytopMaterialCode(String topMaterialCode);
}
@@ -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;
/**
* <p>
* 物料工时工序表 服务类
@@ -12,5 +15,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
* @since 2024-06-19
*/
public interface CostMaterialProcessHoursService extends IService<CostMaterialProcessHours> {
/**
* 查询满足物料编号的工时工序
*/
Map<String,List<CostMaterialProcessHours>> getProcessHoursByMaterialNo(List<String> materialNos);
}
@@ -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;
/**
* <p>
* 物料采购单价 服务类
@@ -12,5 +17,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
* @since 2024-06-19
*/
public interface CostPurchasePriceService extends IService<CostPurchasePrice> {
/**
* 查询满足物料编号的最低采购价
*/
Map<String, BigDecimal> getMinCostPurchasePriceByMaterialNo(List<String> materialNos);
}
@@ -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;
/**
* <p>
* 标准成本明细表 服务类
* </p>
*
* @author cost_purchase_price
* @author app_scene_cost_purchase_price
* @since 2024-06-19
*/
public interface CostStandardDetailService extends IService<CostStandardDetail> {
/**
* 分页查询
*
* @param page
* @param
* @return
*/
IPage<CostStandardDetailVO> pageList(Page<CostStandardDetailVO> page, CostStandardDetailVO costStandard);
/**
* 导出列表信息为Excel文件
*
* @param request
* @param response
* @param costStandardDetailSearch
* @return
*/
JSONObject exportExcel(HttpServletRequest request, HttpServletResponse response, CostStandardDetailSearch costStandardDetailSearch);
}
@@ -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<AppSceneCostCount> {
/**
* 查看关键缺失部件
* @param id
* @return
*/
AppSceneCostCount queryMissingComponentById(String id);
/**
* 重新计算
* @param id
* @return
*/
AppSceneCostCount recountById(Integer id);
/**
* 添加标准成本计算任务
* @param appSceneCostCount
*/
void addCostCountTask(AppSceneCostCount appSceneCostCount);
}
@@ -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<FlowDefinition> queryListResult(Wrapper<FlowDefinition> queryWrapper);
}
@@ -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<AppSceneCostResultValue> {
/**
* 根据顶级物料编码查询满足条件的结果值
* @param topMaterialCode
* @return
*/
List<AppSceneCostResultValue> getResultValueByTopMaterialNo(String topMaterialCode,String taskType,String flowInstanceId);
}
@@ -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<BudgetPrice> {
}
@@ -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<C7525cost> {
}
@@ -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<CostCenter> {
}
@@ -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<CostStandard> {
/**
* 分页查询
* @param page
* @param
* @return
*/
IPage<CostStandardVO> pageList(Page<CostStandardVO> page, CostStandardVO costStandard);
}
@@ -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<CostStandardVersio
* @return
*/
Result<?> importExcel(HttpServletRequest request, HttpServletResponse response, Class<CostStandardVersion> costStandardVersionClass);
/**
* 分页查询
* @param
* @return
*/
List<CostStandardVersion> queryListResult(String versionNumber);
}
@@ -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<LatestPurchasePrice> {
}
@@ -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<ProduceBatch> {
}
@@ -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<SapSubfactory> {
}
@@ -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<AppSceneCostCountMapper, AppSceneCostCount> 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());
}
}
}
}
@@ -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<FlowDefinition> queryListResult(Wrapper<FlowDefinition> queryWrapper) {
List list = flowDefinitionMapper.selectList(queryWrapper);
return list;
}
}
@@ -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<AppSceneCostResultValueMapper, AppSceneCostResultValue> implements IAppSceneCostResultValueService {
@Autowired
private AppSceneCostResultValueMapper appSceneCostResultValueMapper;
/**
* 根据顶级物料编码查询满足条件的结果值
*
* @param topMaterialCode
* @param lastTaskType
* @param flowInstanceId
* @return
*/
@Override
public List<AppSceneCostResultValue> getResultValueByTopMaterialNo(String topMaterialCode, String lastTaskType, String flowInstanceId) {
List<AppSceneCostResultValue> result = new ArrayList<>();
QueryWrapper<AppSceneCostResultValue> 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;
}
}
@@ -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<CostStandardDetailVO> costStandardDetailVOS = costStandardDetailMapper.queryListResult(wrapper);
List<BomTreeInfoVO> bomTreeInfoVOS = BomTreeBuilder.buildBomTree(costStandardDetailVOS);
//查询所有满足条件的父节点
List<CostStandardDetailVO> parentNodeList = costStandardDetailMapper.queryListResult(wrapper);
//所有子类节点
List<CostStandardDetailVO> childrenNodeList = new ArrayList<>();
Map<String, CostStandardDetailVO> parentDataMap = new TreeMap<>();
if (parentNodeList.size() > 0) {
//父类结果只有1个
if (parentNodeList.size() == 1) {
parentDataMap = parentNodeList.stream().collect(Collectors.toMap(CostStandardDetailVO::getMaterialNumber, vo -> vo));
} else {
//父类结果有多个(找出最上级节点)
Map<Integer, List<CostStandardDetailVO>> levelGroupMap = parentNodeList.stream().collect(Collectors.groupingBy(CostStandardDetailVO::getLevel));
TreeMap<Integer, List<CostStandardDetailVO>> levelTreeMap = new TreeMap<>(levelGroupMap);
parentDataMap = levelTreeMap.firstEntry().getValue().stream().collect(Collectors.toMap(CostStandardDetailVO::getMaterialNumber, vo -> vo));
}
//查询所有父节点下的子节点(即第二层叶子节点)
List<CostStandardDetail> costStandardDetails = new ArrayList<>();
if (parentDataMap.size() > 0) {
QueryWrapper<CostStandardDetail> 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<CostStandardDetail> threeNodes = new ArrayList<>();
if (costStandardDetails != null && costStandardDetails.size() > 0) {
List<String> materialNoList = costStandardDetails.stream().map(CostStandardDetail::getMaterialNumber).collect(Collectors.toList());
QueryWrapper<CostStandardDetail> 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<BomTreeInfoVO> bomTreeInfoVOS = BomTreeBuilder.buildBomTree(childrenNodeList, parentDataMap);
return bomTreeInfoVOS;
}
}

Some files were not shown because too many files have changed in this diff Show More