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

This commit was merged in pull request #12.
This commit is contained in:
bgy
2024-08-28 18:59:12 +08:00
committed by Gitea
118 changed files with 27587 additions and 2 deletions
+45
View File
@@ -0,0 +1,45 @@
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
### Mac OS ###
.DS_Store
## backend
**/target
**/logs
*.log
## front
**/*.lock
*.flattened-pom.xml
-2
View File
@@ -1,2 +0,0 @@
# cost-backend
+217
View File
@@ -0,0 +1,217 @@
<?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 Cost Manage</name>
<modules>
<module>qomo-kn-cost-manage-start</module>
<module>qomo-kn-cost-manage</module>
</modules>
<developers>
<developer>
<name>武汉中制智造</name>
<email>qomo@163.com</email>
</developer>
</developers>
<parent>
<groupId>org.qomo.boot</groupId>
<artifactId>qomo-base</artifactId>
<version>2.0.1-SNAPSHOT</version>
<relativePath/>
</parent>
<properties>
<revision>2.0.0-SNAPSHOT</revision>
<adp.version>2.0.0-SNAPSHOT</adp.version>
<dmp.version>2.0.0-SNAPSHOT</dmp.version>
</properties>
<repositories>
<repository>
<id>zzzz</id>
<name>zzzz Repository</name>
<url>http://192.168.50.9:8091/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>aliyun</id>
<name>aliyun Repository</name>
<url>https://maven.aliyun.com/repository/public</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>zzzz-releases</id>
<name>zzzz-releases Repository</name>
<url>http://192.168.50.9:8091/repository/zzzz-releases/</url>
</repository>
<snapshotRepository>
<id>zzzz-snapshots</id>
<name>zzzz Snapshot Repository</name>
<url>http://192.168.50.9:8091/repository/zzzz-snapshots/</url>
</snapshotRepository>
</distributionManagement>
<pluginRepositories>
<pluginRepository>
<id>zzzz</id>
<name>zzzz Repository</name>
<url>http://192.168.50.9:8091/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>aliyun</id>
<name>aliyun Repository</name>
<url>https://maven.aliyun.com/repository/public</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.zzsmart.qomo</groupId>
<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>
</dependencies>
</dependencyManagement>
<!-- 环境 -->
<profiles>
<!-- 开发 -->
<profile>
<id>dev</id>
<activation>
<!--默认激活配置-->
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!--当前环境-->
<profile.name>dev</profile.name>
<!--Nacos服务地址-->
<config.server-addr>jeecg-boot-nacos:8848</config.server-addr>
<!--Nacos配置中心命名空间,用于支持多环境.这里必须使用ID,不能使用名称,默认为空-->
<config.namespace></config.namespace>
<!--Nacos配置分组名称-->
<config.group>DEFAULT_GROUP</config.group>
<!--Nacos用户名-->
<config.username></config.username>
<!--Nacos密码-->
<config.password></config.password>
</properties>
</profile>
<!-- 测试Nacos开启鉴权、设置分组和命名空间
<profile>
<id>dev</id>
<properties>
<profile.name>dev</profile.name>
<config.server-addr>jeecg-boot-nacos:8848</config.server-addr>
<config.namespace>ac14ab82-51f8-4f0c-aa5b-25fb8384bfb6</config.namespace>
<config.group>JEECGDEV_GROUP</config.group>
<config.username>nacos</config.username>
<config.password>nacos</config.password>
</properties>
</profile> -->
<!-- 测试 -->
<profile>
<id>test</id>
<properties>
<!--当前环境-->
<profile.name>test</profile.name>
<!--Nacos服务地址-->
<config.server-addr>jeecg-boot-nacos:8848</config.server-addr>
<!--Nacos配置中心命名空间,用于支持多环境.这里必须使用ID,不能使用名称,默认为空-->
<config.namespace></config.namespace>
<!--Nacos配置分组名称-->
<config.group>DEFAULT_GROUP</config.group>
<!--Nacos用户名-->
<config.username></config.username>
<!--Nacos密码-->
<config.password></config.password>
</properties>
</profile>
<!-- 生产 -->
<profile>
<id>prod</id>
<properties>
<!--当前环境-->
<profile.name>prod</profile.name>
<!--Nacos服务地址-->
<config.server-addr>jeecg-boot-nacos:8848</config.server-addr>
<!--Nacos配置中心命名空间,用于支持多环境.这里必须使用ID,不能使用名称,默认为空-->
<config.namespace></config.namespace>
<!--Nacos配置分组名称-->
<config.group>DEFAULT_GROUP</config.group>
<!--Nacos用户名-->
<config.username></config.username>
<!--Nacos密码-->
<config.password></config.password>
</properties>
</profile>
<!-- SpringCloud运行环境 -->
</profiles>
</project>
+102
View File
@@ -0,0 +1,102 @@
<?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>
<parent>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-kn-forecast</artifactId>
<version>${revision}</version>
</parent>
<artifactId>qomo-kn-cost-manage-start</artifactId>
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>spring-boot-starter-logging</artifactId>
<groupId>org.springframework.boot</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-kn-cost-manage</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!-- <fork>true</fork> &lt;!&ndash; 如果没有该配置,devtools不会生效 &ndash;&gt;-->
<includeSystemScope>true</includeSystemScope>
</configuration>
</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>
@@ -0,0 +1,41 @@
<assembly>
<id>dist</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${basedir}/src/main/bin</directory>
<lineEnding>unix</lineEnding>
<outputDirectory/>
<fileMode>755</fileMode>
<includes>
<include>*.sh</include>
</includes>
</fileSet>
<fileSet>
<directory>${basedir}/src/main/bin</directory>
<lineEnding>windows</lineEnding>
<outputDirectory/>
<includes>
<include>*.bat</include>
</includes>
</fileSet>
<fileSet>
<directory>target/classes</directory>
<outputDirectory>config</outputDirectory>
<includes>
<include>**/*.yml</include>
<include>**/*.yaml</include>
<include>**/logback-spring.xml</include>
</includes>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>lib</outputDirectory>
<unpack>false</unpack>
</dependencySet>
</dependencySets>
</assembly>
@@ -0,0 +1,48 @@
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;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;
import java.net.InetAddress;
import java.net.UnknownHostException;
/**
* 单体启动类
* 报错提醒: 未集成mongo报错,可以打开启动类上面的注释 exclude={MongoAutoConfiguration.class}
*/
@Slf4j
@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 {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(QomoCostManageApplication.class);
}
public static void main(String[] args) throws UnknownHostException {
ConfigurableApplicationContext application = SpringApplication.run(QomoCostManageApplication.class, args);
Environment env = application.getEnvironment();
String ip = InetAddress.getLocalHost().getHostAddress();
String port = env.getProperty("server.port");
String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path"));
log.info("\n----------------------------------------------------------\n\t" +
"Application Jeecg-Boot is running! Access URLs:\n\t" +
"Local: \t\thttp://localhost:" + port + path + "/\n\t" +
"External: \thttp://" + ip + ":" + port + path + "/\n\t" +
"Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n" +
"----------------------------------------------------------");
}
}
@@ -0,0 +1,453 @@
v2:
#虚拟路径映射路径 2个文件路径一一对应 第一个为主存储,其他为配置相关
xnljmap:
#win服务器 本地 注意!! 记住这个结尾有一个/
oss: file:/data/qomo-boot/oss/
# oss: file:D:/upload/
#linux服务器
#oss: file:/home/webapps/oss/
#虚拟路径映射路径 end
#本地存放地址 注意!! 记住这个结尾没有/
fileurl: /data/qomo-boot/oss
# fileurl: D:/upload
#http://127.0.0.1:8080/oss/{yy}/2022-12-22/c83a77ae134a540c30daa6a0666fa945.md
httpurl: /qomo/
defaultFormat: .png
server:
port: 8098
tomcat:
max-swallow-size: -1
error:
include-exception: true
include-stacktrace: ALWAYS
include-message: ALWAYS
servlet:
context-path: /qomo
compression:
enabled: true
min-response-size: 1024
mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
management:
endpoints:
web:
exposure:
include: metrics,httptrace
spring:
servlet:
multipart:
max-file-size: 10MB
max-request-size: 10MB
mail:
host: smtp.163.com
username: jeecgos@163.com
password: ??
properties:
mail:
smtp:
auth: true
starttls:
enable: true
required: true
## quartz定时任务,采用数据库方式
quartz:
job-store-type: jdbc
initialize-schema: embedded
#定时任务启动开关,true-开 false-关
auto-startup: true
#延迟1秒启动定时任务
startup-delay: 1s
#启动时更新己存在的Job
overwrite-existing-jobs: true
properties:
org:
quartz:
scheduler:
instanceName: MyScheduler
instanceId: AUTO
jobStore:
class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
tablePrefix: QRTZ_
isClustered: true
misfireThreshold: 12000
clusterCheckinInterval: 15000
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 10
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
#json 时间戳统一转换
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
jpa:
open-in-view: false
# http请求配置
rest:
livy:
server: http://192.168.50.9:7997
spark:
# 组件部署路径,默认是部署在hdfs 如果是本地路径则在前面加上local:
main-jar: local:/opt/services/deploy-jars/dev/qomo-data-component-${Qomo.version}-jar-with-dependencies.jar
main-class: com.zzsmart.qomo.QomoSparkStarter
# spark默认运行参数
deploy-mode: cluster
queue: default
num-executors: 2
executor-cores: 1
executor-memory: 1G
driver-cores: 1
driver-memory: 512M
# 客户端类型
client-type: urlconnection
# URLConnection配置
url-connection:
# 客户端和服务器建立连接超时时间
connect-timeout: 2000
# 客户端从服务器读取数据包超时时间
read-timeout: 30000
# 是否长链接
keep-alive: false
# HttpClient配置
http-client:
# 连接池的最大连接数
max-total-connect: 200
# 相同域名允许创建的最大连接数
max-connect-per-route: 10
# 客户端和服务器建立连接超时时间
connect-timeout: 2000
# 读数据的超时时间
socket-timeout: 30000
# 连接池创建连接时的超时时间
connection-request-timout: 200
# OKHttp配置
ok-http:
# 失败后是否重试
retry-on-connection-failure: false
# 链接超时时间
connect-timeout: 2000
# 读超时时间
read-timeout: 10000
# 写超时时间
write-timeout: 10000
# 最大空闲的连接数
max-idle-connections: 5
# 最大的空闲时间
keep-alive-duration-ns: 3000
aop:
proxy-target-class: true
#配置freemarker
freemarker:
# 设置模板后缀名
suffix: .ftl
# 设置文档类型
content-type: text/html
# 设置页面编码格式
charset: UTF-8
# 设置页面缓存
cache: false
prefer-file-system-access: false
# 设置ftl文件路径
template-loader-path:
- classpath:/templates
template_update_delay: 0
# 设置静态文件路径,js,css等
mvc:
static-path-pattern: /**
#Spring Boot 2.6+后映射匹配的默认策略已从AntPathMatcher更改为PathPatternParser,需要手动指定为ant-path-matcher
pathmatch:
matching-strategy: ant_path_matcher
resource:
static-locations: classpath:/static/,classpath:/public/
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
datasource:
druid:
stat-view-servlet:
enabled: true
loginUsername: admin
loginPassword: 123456
allow:
web-stat-filter:
enabled: true
dynamic:
druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
# 连接池的配置信息
# 初始化大小,最小,最大
initial-size: 5
min-idle: 5
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
# 打开PSCache,并且指定每个连接上PSCache的大小
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
filters: stat,slf4j
filter:
wall:
config:
none-base-statement-allow: true
multi-statement-allow: true
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource:
# master:
# url: jdbc:mysql://192.168.50.9:2212/selef_report?useUnicode=true&allowMultiQueries=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useSSL=false
# username: zzzz
# password: knphm2021
# driver-class-name: com.mysql.cj.jdbc.Driver
master:
url: jdbc:mysql://158.158.4.51:13306/kn_otd_app?useUnicode=true&allowMultiQueries=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&serverTimezone=Asia/Shanghai&useSSL=false
username: knotd
password: otd@2024
driver-class-name: com.mysql.cj.jdbc.Driver
# 多数据源配置
#multi-datasource1:
#url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
#username: root
#password: root
#driver-class-name: com.mysql.cj.jdbc.Driver
#redis 配置
redis:
# 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
#rabbitmq 配置
rabbitmq:
host: 192.168.50.9
port: 5672
virtual-host: /qomoflow-standardcost
username: admin
password: kncloud
connection-timeout: 5000
listener:
simple:
concurrency: 5 # 并发数量
max-concurrency: 10 # 最大并发数量
acknowledge-mode: manual # 开启手动签收
prefetch: 1 # 限制每次只消费一个(一个线程)
#mybatis plus 设置
mybatis-plus:
mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml,classpath*:/mapper/*.xml,classpath*:com/zzsmart/qomo/**/mapper/xml/*.xml
global-config:
# 关闭MP3.0自带的banner
banner: false
db-config:
#主键类型 0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
id-type: ASSIGN_ID
# 默认数据库表下划线命名
table-underline: true
configuration:
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
# 返回类型为Map,显示null对应的字段
call-setters-on-nulls: true
#jeecg专用配置
minidao:
base-package: org.jeecg.modules.jmreport.*,org.jeecg.modules.drag.*
jeecg:
# 是否启用安全模式
safeMode: false
# 签名密钥串(前后端要一致,正式发布请自行修改)
signatureSecret: dd05f1c54d63749eda95f9fa6d49v442a
# 签名拦截接口
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys
#local、minio、alioss
uploadType: local
# 前端访问地址
domainUrl:
pc: http://localhost:3100
app: http://localhost:8051
path:
#文件上传根目录 设置
upload: /opt/upFiles
#webapp文件路径
webapp: /opt/webapp
shiro:
# excludeUrls: /api/internalService/**,/test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**,/dataCheck/**
excludeUrls: /**/**,/**/**/**
#阿里云oss存储和大鱼短信秘钥配置
oss:
accessKey: ??
secretKey: ??
endpoint: oss-cn-beijing.aliyuncs.com
bucketName: jeecgdev
# ElasticSearch 6设置
elasticsearch:
cluster-name: elasticsearch-cluster
cluster-nodes: 192.168.50.9:9200
check-enabled: false
task-data-index: task_data_dev/_doc
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
#大屏报表参数设置
jmreport:
mode: dev
#数据字典是否进行saas数据隔离,自己看自己的字典
saas: false
#xxl-job配置
xxljob:
enabled: false
adminAddresses: http://127.0.0.1:9080/xxl-job-admin
appname: ${spring.application.name}
accessToken: ''
address: 127.0.0.1:30007
ip: 127.0.0.1
port: 30007
logPath: logs/jeecg/job/jobhandler/
logRetentionDays: 30
#分布式锁配置
redisson:
address: 127.0.0.1:6379
password:
type: STANDALONE
enabled: true
#cas单点登录
cas:
server:
host:
#CAS服务地址
url: http://192.168.50.9:8167/cas
#Mybatis输出sql日志
logging:
level:
org.jeecg.modules.system.mapper: info
#swagger
knife4j:
#开启增强配置
enable: true
#开启生产环境屏蔽
production: false
basic:
enable: false
username: jeecg
password: jeecg1314
#第三方登录
justauth:
enabled: true
type:
GITHUB:
client-id: ??
client-secret: ??
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/github/callback
WECHAT_ENTERPRISE:
client-id: ??
client-secret: ??
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_enterprise/callback
agent-id: ??
DINGTALK:
client-id: ??
client-secret: ??
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/dingtalk/callback
WECHAT_OPEN:
client-id: ??
client-secret: ??
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_open/callback
cache:
type: default
prefix: 'demo::'
timeout: 1h
#第三方APP对接
third-app:
enabled: false
type:
#企业微信
WECHAT_ENTERPRISE:
enabled: false
#CORP_ID
client-id: ??
#SECRET
client-secret: ??
#自建应用id
agent-id: ??
#自建应用秘钥(新版企微需要配置)
# agent-app-secret: ??
#钉钉
DINGTALK:
enabled: false
# appKey
client-id: ??
# appSecret
client-secret: ??
agent-id: ??
spark:
app:
name: yl
home: 127.0.0.1
master:
uri: local[*]
driver:
memory: 2g
worker:
memory: 2g
executor:
memory: 1g
rpc:
message:
maxSize: 1024
flowable:
process:
definition-cache-limit: -1
database-schema-update: true
activity-font-name: 宋体
label-font-name: 宋体
annotation-font-name: 宋体
#关闭定时任务JOB
async-executor-activate: false
#消息链接基地址
message-base-url: http://192.168.50.9:3000/flowable/task/record/
Qomo:
version: @project.version@
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
hdfs:
enable: false
minio:
server: http://192.168.50.9
port: 9100
access-key: admin
secret-key: qm123456
condaEnv: py310
tikaServerUrl: http://192.168.50.99:8099/qomo-tika/
@@ -0,0 +1,451 @@
v2:
#虚拟路径映射路径 2个文件路径一一对应 第一个为主存储,其他为配置相关
xnljmap:
#win服务器 本地 注意!! 记住这个结尾有一个/
oss: file:/data/qomo-boot/oss/
# oss: file:D:/upload/
#linux服务器
#oss: file:/home/webapps/oss/
#虚拟路径映射路径 end
#本地存放地址 注意!! 记住这个结尾没有/
fileurl: /data/qomo-boot/oss
# fileurl: D:/upload
#http://127.0.0.1:8080/oss/{yy}/2022-12-22/c83a77ae134a540c30daa6a0666fa945.md
httpurl: /qomo/
defaultFormat: .png
server:
port: 8095
tomcat:
max-swallow-size: -1
error:
include-exception: true
include-stacktrace: ALWAYS
include-message: ALWAYS
servlet:
context-path: /qomo
compression:
enabled: true
min-response-size: 1024
mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
management:
endpoints:
web:
exposure:
include: metrics,httptrace
spring:
servlet:
multipart:
max-file-size: 10MB
max-request-size: 10MB
mail:
host: smtp.163.com
username: jeecgos@163.com
password: ??
properties:
mail:
smtp:
auth: true
starttls:
enable: true
required: true
## quartz定时任务,采用数据库方式
quartz:
job-store-type: jdbc
initialize-schema: embedded
#定时任务启动开关,true-开 false-关
auto-startup: true
#延迟1秒启动定时任务
startup-delay: 1s
#启动时更新己存在的Job
overwrite-existing-jobs: true
properties:
org:
quartz:
scheduler:
instanceName: MyScheduler
instanceId: AUTO
jobStore:
class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
tablePrefix: QRTZ_
isClustered: true
misfireThreshold: 12000
clusterCheckinInterval: 15000
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 10
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
#json 时间戳统一转换
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
jpa:
open-in-view: false
# http请求配置
rest:
livy:
server: http://192.168.50.9:7997
spark:
# 组件部署路径,默认是部署在hdfs 如果是本地路径则在前面加上local:
main-jar: local:/opt/services/deploy-jars/dev/qomo-data-component-${Qomo.version}-jar-with-dependencies.jar
main-class: com.zzsmart.qomo.QomoSparkStarter
# spark默认运行参数
deploy-mode: cluster
queue: default
num-executors: 2
executor-cores: 1
executor-memory: 1G
driver-cores: 1
driver-memory: 512M
# 客户端类型
client-type: urlconnection
# URLConnection配置
url-connection:
# 客户端和服务器建立连接超时时间
connect-timeout: 2000
# 客户端从服务器读取数据包超时时间
read-timeout: 30000
# 是否长链接
keep-alive: false
# HttpClient配置
http-client:
# 连接池的最大连接数
max-total-connect: 200
# 相同域名允许创建的最大连接数
max-connect-per-route: 10
# 客户端和服务器建立连接超时时间
connect-timeout: 2000
# 读数据的超时时间
socket-timeout: 30000
# 连接池创建连接时的超时时间
connection-request-timout: 200
# OKHttp配置
ok-http:
# 失败后是否重试
retry-on-connection-failure: false
# 链接超时时间
connect-timeout: 2000
# 读超时时间
read-timeout: 10000
# 写超时时间
write-timeout: 10000
# 最大空闲的连接数
max-idle-connections: 5
# 最大的空闲时间
keep-alive-duration-ns: 3000
aop:
proxy-target-class: true
#配置freemarker
freemarker:
# 设置模板后缀名
suffix: .ftl
# 设置文档类型
content-type: text/html
# 设置页面编码格式
charset: UTF-8
# 设置页面缓存
cache: false
prefer-file-system-access: false
# 设置ftl文件路径
template-loader-path:
- classpath:/template
# - d:/data
template_update_delay: 0
# 设置静态文件路径,js,css等
mvc:
static-path-pattern: /**
#Spring Boot 2.6+后映射匹配的默认策略已从AntPathMatcher更改为PathPatternParser,需要手动指定为ant-path-matcher
pathmatch:
matching-strategy: ant_path_matcher
resource:
static-locations: classpath:/static/,classpath:/public/
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
datasource:
druid:
stat-view-servlet:
enabled: true
loginUsername: admin
loginPassword: 123456
allow:
web-stat-filter:
enabled: true
dynamic:
druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
# 连接池的配置信息
# 初始化大小,最小,最大
initial-size: 5
min-idle: 5
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
# 打开PSCache,并且指定每个连接上PSCache的大小
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
filters: stat,slf4j
filter:
wall:
config:
none-base-statement-allow: true
multi-statement-allow: true
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource:
master:
url: jdbc:mysql://192.168.50.9:2212/otd?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
driver-class-name: com.mysql.cj.jdbc.Driver
# 多数据源配置
#multi-datasource1:
#url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
#username: root
#password: root
#driver-class-name: com.mysql.cj.jdbc.Driver
#redis 配置
redis:
database: 9
host: 192.168.50.9
port: 7379
password: 'zzboard'
main:
allow-circular-references: true
#rabbitmq 配置
rabbitmq:
host: 192.168.50.9
port: 5672
virtual-host: /qomoflow-dev
username: admin
password: kncloud
connection-timeout: 5000
listener:
simple:
concurrency: 5 # 并发数量
max-concurrency: 10 # 最大并发数量
acknowledge-mode: manual # 开启手动签收
prefetch: 1 # 限制每次只消费一个(一个线程)
#mybatis plus 设置
mybatis-plus:
mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml,classpath*:/mapper/*.xml,classpath*:com/zzsmart/qomo/**/mapper/xml/*.xml
global-config:
# 关闭MP3.0自带的banner
banner: false
db-config:
#主键类型 0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
id-type: ASSIGN_ID
# 默认数据库表下划线命名
table-underline: true
configuration:
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
# 返回类型为Map,显示null对应的字段
call-setters-on-nulls: true
#jeecg专用配置
minidao:
base-package: org.jeecg.modules.jmreport.*,org.jeecg.modules.drag.*
jeecg:
# 是否启用安全模式
safeMode: false
# 签名密钥串(前后端要一致,正式发布请自行修改)
signatureSecret: dd05f1c54d63749eda95f9fa6d49v442a
# 签名拦截接口
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys
#local、minio、alioss
uploadType: local
# 前端访问地址
domainUrl:
pc: http://localhost:3100
app: http://localhost:8051
path:
#文件上传根目录 设置
upload: /opt/upFiles
#webapp文件路径
webapp: /opt/webapp
shiro:
# excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**,/api/getUserInfo,/sys/sysDepart/**,/taskSocket/**,/flowSocket/**
excludeUrls: /**/**,/**/**/**
#阿里云oss存储和大鱼短信秘钥配置
oss:
accessKey: ??
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
cluster-nodes: 192.168.50.9:9200
check-enabled: false
task-data-index: task_data_dev/_doc
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
# 在线预览文件服务器地址配置
file-view-domain: http://fileview.jeecg.com
# minio文件上传
# minio:
# minio_url: http://minio.jeecg.com
# minio_name: ??
# minio_pass: ??
# bucketName: otatest
#大屏报表参数设置
jmreport:
mode: dev
#数据字典是否进行saas数据隔离,自己看自己的字典
saas: false
#xxl-job配置
xxljob:
enabled: false
adminAddresses: http://127.0.0.1:9080/xxl-job-admin
appname: ${spring.application.name}
accessToken: ''
address: 127.0.0.1:30007
ip: 127.0.0.1
port: 30007
logPath: logs/jeecg/job/jobhandler/
logRetentionDays: 30
#分布式锁配置
redisson:
address: 127.0.0.1:6379
password:
type: STANDALONE
enabled: true
#cas单点登录
cas:
server:
host:
#CAS服务地址
url: http://192.168.50.9:8167/cas
#Mybatis输出sql日志
logging:
level:
org.jeecg.modules.system.mapper: info
#swagger
knife4j:
#开启增强配置
enable: true
#开启生产环境屏蔽
production: false
basic:
enable: false
username: jeecg
password: jeecg1314
#第三方登录
justauth:
enabled: true
type:
GITHUB:
client-id: ??
client-secret: ??
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/github/callback
WECHAT_ENTERPRISE:
client-id: ??
client-secret: ??
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_enterprise/callback
agent-id: ??
DINGTALK:
client-id: ??
client-secret: ??
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/dingtalk/callback
WECHAT_OPEN:
client-id: ??
client-secret: ??
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_open/callback
cache:
type: default
prefix: 'demo::'
timeout: 1h
#第三方APP对接
third-app:
enabled: false
type:
#企业微信
WECHAT_ENTERPRISE:
enabled: false
#CORP_ID
client-id: ??
#SECRET
client-secret: ??
#自建应用id
agent-id: ??
#自建应用秘钥(新版企微需要配置)
# agent-app-secret: ??
#钉钉
DINGTALK:
enabled: false
# appKey
client-id: ??
# appSecret
client-secret: ??
agent-id: ??
spark:
app:
name: yl
home: 127.0.0.1
master:
uri: local[*]
driver:
memory: 2g
worker:
memory: 2g
executor:
memory: 1g
rpc:
message:
maxSize: 1024
flowable:
process:
definition-cache-limit: -1
database-schema-update: true
activity-font-name: 宋体
label-font-name: 宋体
annotation-font-name: 宋体
#关闭定时任务JOB
async-executor-activate: false
#消息链接基地址
message-base-url: http://192.168.50.9:3000/flowable/task/record/
Qomo:
version: @project.version@
modelPath: /opt/services/deploy-jars/algo/model
seaTunnelHome: /opt/service/apache-seatunnel-2.3.4
hiveMetastoreUri: thrift://192.168.50.102:9083
minio:
server: http://192.168.50.102
port: 9000
access-key: admin
secret-key: minioadmin
bucketName: bucket1
condaEnv: py310
analysis:
consistency:
url: http://192.168.50.9:1314/analysis
@@ -0,0 +1,5 @@
spring:
application:
name: qomo-forecast
profiles:
active: dev
@@ -0,0 +1,29 @@
#code_generate_project_path
project_path=E:\\workspace\\qomoai
#bussi_package[User defined]
bussi_package=com.zzsmart.qomo.modules.demo
#default code path
#source_root_package=src
#webroot_package=WebRoot
#maven code path
source_root_package=src.main.java
webroot_package=src.main.webapp
#ftl resource url
templatepath=/jeecg/code-template
system_encoding=utf-8
#db Table id [User defined]
db_table_id=id
#db convert flag[true/false]
db_filed_convert=true
#page Search Field num [User defined]
page_search_filed_num=1
#page_filter_fields
page_filter_fields=create_time,create_by,update_time,update_by
exclude_table=act_,ext_act_,design_,onl_,sys_,qrtz_
@@ -0,0 +1,27 @@
#mysql
diver_name=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/qomo?useUnicode=true&characterEncoding=UTF-8
username=root
password=root
database_name=qomo
#oracle
#diver_name=oracle.jdbc.driver.OracleDriver
#url=jdbc:oracle:thin:@192.168.1.200:1521:ORCL
#username=scott
#password=tiger
#database_name=ORCL
#postgre
#diver_name=org.postgresql.Driver
#url=jdbc:postgresql://localhost:5432/qomo
#username=postgres
#password=postgres
#database_name=qomo
#SQLServer2005以上
#diver_name=org.hibernate.dialect.SQLServerDialect
#url=jdbc:sqlserver://192.168.1.200:1433;DatabaseName=qomo
#username=sa
#password=SA
#database_name=qomo
@@ -0,0 +1,96 @@
ALTER TABLE `sys_permission`
ADD COLUMN `type` varchar(255) NULL COMMENT '类型 CDM 公共层 ADS 应用层' AFTER `middle`;
CREATE TABLE `sys_application`
(
`id` varchar(255) NOT NULL COMMENT '主键',
`app_name` varchar(255) NULL COMMENT '应用名称',
`app_code` varchar(255) NULL COMMENT '应用编码',
`app_icon` varchar(255) NULL COMMENT '应用图标',
`app_color` varchar(255) NULL COMMENT '应用颜色',
`app_belong` varchar(255) NULL COMMENT '应用所属',
`app_kind` varchar(255) NULL COMMENT '应用种类',
`app_type` varchar(255) NULL COMMENT '应用类型',
`function_module` varchar(255) NULL COMMENT '功能模块',
`main_menu_url` varchar(255) NULL COMMENT '主菜单路径',
`main_menu_name` varchar(255) NULL COMMENT '主菜单名称',
`sort` int NULL COMMENT '排序',
`create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'creator id',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT 'create time',
`update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'updator id',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT 'update time',
PRIMARY KEY (`id`)
) COMMENT = '系统应用表';
CREATE TABLE `sys_app_menu`
(
`id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '主键',
`app_id` varchar(255) NULL COMMENT '应用id',
`menu_id` varchar(255) NULL COMMENT '菜单id',
`create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'creator id',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT 'create time',
`update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'updator id',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT 'update time',
PRIMARY KEY (`id`)
) COMMENT = '应用菜单';
ALTER TABLE `qomo_database_file`
ADD COLUMN `record_count` bigint NULL COMMENT '记录数' AFTER `absolute_path`;
CREATE TABLE `qomo_python_package` (
`id` varchar(255) NOT NULL COMMENT '主键',
`package_name` varchar(255) NULL COMMENT '包名',
`version` varchar(255) NULL COMMENT '版本',
`create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'creator id',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT 'create time',
`update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'updator id',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT 'update time',
PRIMARY KEY (`id`)
) COMMENT = 'python包管理';
CREATE TABLE `sys_org` (
`id` varchar(255) NOT NULL COMMENT 'ID',
`org_name` varchar(255) NULL COMMENT '组织名称',
`org_code` varchar(255) NULL COMMENT '组织编码',
`org_Industry` varchar(255) NULL COMMENT '所属行业',
`org_scale` varchar(255) NULL COMMENT '公司规模',
`org_addr` varchar(255) NULL COMMENT '公司地址',
`org_logo` varchar(255) NULL COMMENT '组织logo',
`org_state` varchar(255) NULL COMMENT '公司状态',
`create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'creator id',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT 'create time',
`update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'updator id',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT 'update time',
PRIMARY KEY (`id`)
) COMMENT = '组织';
CREATE TABLE `sys_app_org` (
`id` varchar(255) NOT NULL COMMENT 'ID',
`app_id` varchar(255) NULL COMMENT '应用ID',
`org_id` varchar(255) NULL COMMENT '组织ID',
`create_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'creator id',
`create_time` datetime(0) NULL DEFAULT NULL COMMENT 'create time',
`update_by` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'updator id',
`update_time` datetime(0) NULL DEFAULT NULL COMMENT 'update time',
PRIMARY KEY (`id`)
) COMMENT = '应用组织关联表';
# 2024-03-27
ALTER TABLE `sys_org`
ADD COLUMN `org_desc` varchar(255) NULL COMMENT '描述' AFTER `org_state`;
# 2024-03-29
ALTER TABLE `sys_depart`
MODIFY COLUMN `org_category` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NULL DEFAULT '1' COMMENT '机构类别 1公司,2组织机构,2岗位' AFTER `description`,
ADD COLUMN `org_id` varchar(255) NULL COMMENT '组织ID' AFTER `org_code`,
ADD COLUMN `depart_code` varchar(255) NULL COMMENT '组织ID' AFTER `org_code`;
ALTER TABLE `sys_role`
ADD COLUMN `org_id` varchar(255) NULL COMMENT '组织ID' AFTER `role_code`;
ALTER TABLE `sys_user`
ADD COLUMN `org_id` varchar(255) NULL COMMENT '组织ID' AFTER `bpm_status`;
ALTER TABLE `sys_user`
ADD COLUMN `depart_code` varchar(255) NULL COMMENT '登录会话的部门编码' AFTER `org_code`;
File diff suppressed because one or more lines are too long
@@ -0,0 +1,9 @@
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<!-- <include file="liquibase/changelogs/qomo-boot-init.sql" relativeToChangelogFile="false"/>-->
<!-- <include file="liquibase/changelogs/change.sql" relativeToChangelogFile="false"/>-->
</databaseChangeLog>
+27
View File
@@ -0,0 +1,27 @@
<?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>
<parent>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-kn-forecast</artifactId>
<version>${revision}</version>
</parent>
<artifactId>qomo-kn-cost-manage</artifactId>
<dependencies>
<dependency>
<groupId>org.qomo.boot</groupId>
<artifactId>qomo-system-biz</artifactId>
</dependency>
<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.zzsmart.qomo</groupId>
<artifactId>qomo-data-integration</artifactId>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,48 @@
package com.zzsmart.qomo.kn.cost.manage.constants;
import cn.hutool.core.collection.CollUtil;
import java.util.List;
/**
* @author WangBo
* @since 2024/5/17 下午3:05
*/
public interface Constants {
String TRACK = "轨道总部";
List<String> BUSINESS_SEGMENTS = CollUtil.newArrayList("国内业务", "维保业务", "海外业务", "安全门业务", "汽车门业务", "内装业务");
List<String> PROFIT_ITEM_NAMES = CollUtil.newArrayList(
"一、营业总收入",
"其中:营业成本",
"税金及附加",
"销售费用",
"管理费用",
"研发费用",
"财务费用",
"二、营业总成本",
"加:其他收益",
"投资收益(损失以“-”号填列)",
"公允价值变动收益(损失以“-”号填列)",
"信用减值损失(损失以“-”号填列)",
"资产减值损失(损失以“-”号填列)",
"资产处置收益(损失以“-”号填列)",
"三、营业利润",
"加:营业外收入",
"减:营业外支出",
"四、利润总额",
"减:所得税费用",
"五、净利润",
"六、归属于母公司的净利润",
"八、关键指标",
"产品毛利率",
"期间费用",
"期间费用率",
"净利率");
/**
* 下划线
*/
String UNDER_LINE = "_";
}
@@ -0,0 +1,179 @@
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.enums.CostCountStatusEnum;
import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostCountService;
import com.zzsmart.qomo.kn.cost.manage.vo.AppSceneCostCountVO;
import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO;
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.BeanUtils;
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.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @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<AppSceneCostCountVO>> 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);
IPage<AppSceneCostCountVO> pageList1 = new Page<>();
BeanUtils.copyProperties(pageList, pageList1);
List<AppSceneCostCountVO>list=new ArrayList<>();
for(int i=0;i<pageList.getRecords().size();i++){
AppSceneCostCount appSceneCostCount1 = pageList.getRecords().get(i);
AppSceneCostCountVO appSceneCostCountVO = new AppSceneCostCountVO();
BeanUtils.copyProperties(appSceneCostCount1, appSceneCostCountVO);
appSceneCostCountVO.setStatusName(CostCountStatusEnum.getTextByValue(appSceneCostCount1.getStatus()));
list.add(appSceneCostCountVO);
}
pageList1.setRecords(list);
return Result.OK(pageList1);
}
/**
* 添加标准成本计算任务
*
* @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<List<MissingComponentVO>> queryMissingComponentById(@RequestParam(name = "id", required = true) String id) {
List<MissingComponentVO> result = appSceneCostCountService.queryMissingComponentById(id);
if (result == null) {
return Result.error("未找到对应数据");
}
return Result.OK(result);
}
/**
* 导出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,162 @@
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.AppSceneCostHourRate;
import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostHourRateService;
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_hour_rate
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
@Api(tags="cost-小时费率")
@RestController
@RequestMapping("//hourRate")
@Slf4j
public class AppSceneCostHourRateController extends JeecgController<AppSceneCostHourRate, IAppSceneCostHourRateService> {
@Autowired
private IAppSceneCostHourRateService appSceneCostHourRateService;
/**
* 分页列表查询
*
* @param appSceneCostHourRate
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "app_scene_cost_hour_rate-分页列表查询")
@ApiOperation(value = "app_scene_cost_hour_rate-分页列表查询", notes = "app_scene_cost_hour_rate-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppSceneCostHourRate>> queryPageList(AppSceneCostHourRate appSceneCostHourRate,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AppSceneCostHourRate> queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostHourRate, req.getParameterMap());
Page<AppSceneCostHourRate> page = new Page<AppSceneCostHourRate>(pageNo, pageSize);
IPage<AppSceneCostHourRate> pageList = appSceneCostHourRateService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param appSceneCostHourRate
* @return
*/
@AutoLog(value = "app_scene_cost_hour_rate-添加")
@ApiOperation(value = "app_scene_cost_hour_rate-添加", notes = "app_scene_cost_hour_rate-添加")
//@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_hour_rate:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AppSceneCostHourRate appSceneCostHourRate) {
appSceneCostHourRateService.save(appSceneCostHourRate);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param appSceneCostHourRate
* @return
*/
@AutoLog(value = "app_scene_cost_hour_rate-编辑")
@ApiOperation(value = "app_scene_cost_hour_rate-编辑", notes = "app_scene_cost_hour_rate-编辑")
//@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_hour_rate:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody AppSceneCostHourRate appSceneCostHourRate) {
appSceneCostHourRateService.updateById(appSceneCostHourRate);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "app_scene_cost_hour_rate-通过id删除")
@ApiOperation(value = "app_scene_cost_hour_rate-通过id删除", notes = "app_scene_cost_hour_rate-通过id删除")
//@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_hour_rate:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
appSceneCostHourRateService.removeById(id);
return Result.OK("删除成功!");
}
// /**
// * 批量删除
// *
// * @param ids
// * @return
// */
// @AutoLog(value = "app_scene_cost_hour_rate-批量删除")
// @ApiOperation(value = "app_scene_cost_hour_rate-批量删除", notes = "app_scene_cost_hour_rate-批量删除")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_hour_rate:deleteBatch")
// @DeleteMapping(value = "/deleteBatch")
// public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
// this.appSceneCostHourRateService.removeByIds(Arrays.asList(ids.split(",")));
// return Result.OK("批量删除成功!");
// }
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "app_scene_cost_hour_rate-通过id查询")
@ApiOperation(value = "app_scene_cost_hour_rate-通过id查询", notes = "app_scene_cost_hour_rate-通过id查询")
@GetMapping(value = "/queryById")
public Result<AppSceneCostHourRate> queryById(@RequestParam(name = "id", required = true) String id) {
AppSceneCostHourRate appSceneCostHourRate = appSceneCostHourRateService.getById(id);
if (appSceneCostHourRate == null) {
return Result.error("未找到对应数据");
}
return Result.OK(appSceneCostHourRate);
}
// /**
// * 导出excel
// *
// * @param request
// * @param appSceneCostHourRate
// */
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_hour_rate:exportXls")
// @RequestMapping(value = "/exportXls")
// public ModelAndView exportXls(HttpServletRequest request, AppSceneCostHourRate appSceneCostHourRate) {
// return super.exportXls(request, appSceneCostHourRate, AppSceneCostHourRate.class, "app_scene_cost_hour_rate");
// }
// /**
// * 通过excel导入数据
// *
// * @param request
// * @param response
// * @return
// */
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_hour_rate:importExcel")
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
// public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
// return super.importExcel(request, response, AppSceneCostHourRate.class);
// }
}
@@ -0,0 +1,190 @@
package com.zzsmart.qomo.kn.cost.manage.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialBom;
import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostMaterialBomService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @Description: app_scene_cost_material_bom
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
@RequestMapping("//cost-material-bom")
@Api(tags="cost-标准成本-bom信息")
@RestController
@Slf4j
public class AppSceneCostMaterialBomController extends JeecgController<AppSceneCostMaterialBom, IAppSceneCostMaterialBomService> {
@Autowired
private IAppSceneCostMaterialBomService costMaterialBomService;
/**
* 分页列表查询
*
* @param costMaterialBom
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "app_scene_cost_standard_version-分页列表查询")
@ApiOperation(value="物料bom分页列表查询", notes="物料bom分页列表查询")
@GetMapping(value = "/pageList")
public Result<IPage<AppSceneCostMaterialBom>> queryPageList(AppSceneCostMaterialBom costMaterialBom,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AppSceneCostMaterialBom> queryWrapper = QueryGenerator.initQueryWrapper(costMaterialBom, req.getParameterMap());
Page<AppSceneCostMaterialBom> page = new Page<AppSceneCostMaterialBom>(pageNo, pageSize);
IPage<AppSceneCostMaterialBom> pageList = costMaterialBomService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 列表查询
*
* @return
*/
@ApiOperation(value="物料bom列表查询", notes="物料bom列表查询")
@GetMapping(value = "/list")
public Result<List<AppSceneCostMaterialBom>> queryList(@RequestParam(name = "materialNumber",required = false) String materialNumber) {
List<AppSceneCostMaterialBom> list = costMaterialBomService.queryListResult(materialNumber);
return Result.OK(list);
}
// /**
// * 分页列表查询
// *
// * @param appSceneCostMaterialBom
// * @param pageNo
// * @param pageSize
// * @param req
// * @return
// */
// //@AutoLog(value = "app_scene_cost_material_bom-分页列表查询")
// @ApiOperation(value = "app_scene_cost_material_bom-分页列表查询", notes = "app_scene_cost_material_bom-分页列表查询")
// @GetMapping(value = "/list")
// public Result<IPage<AppSceneCostMaterialBom>> queryPageList(AppSceneCostMaterialBom appSceneCostMaterialBom,
// @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
// @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
// HttpServletRequest req) {
// QueryWrapper<AppSceneCostMaterialBom> queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostMaterialBom, req.getParameterMap());
// Page<AppSceneCostMaterialBom> page = new Page<AppSceneCostMaterialBom>(pageNo, pageSize);
// IPage<AppSceneCostMaterialBom> pageList = appSceneCostMaterialBomService.page(page, queryWrapper);
// return Result.OK(pageList);
// }
//
// /**
// * 添加
// *
// * @param appSceneCostMaterialBom
// * @return
// */
// @AutoLog(value = "app_scene_cost_material_bom-添加")
// @ApiOperation(value = "app_scene_cost_material_bom-添加", notes = "app_scene_cost_material_bom-添加")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:add")
// @PostMapping(value = "/add")
// public Result<String> add(@RequestBody AppSceneCostMaterialBom appSceneCostMaterialBom) {
// appSceneCostMaterialBomService.save(appSceneCostMaterialBom);
// return Result.OK("添加成功!");
// }
//
// /**
// * 编辑
// *
// * @param appSceneCostMaterialBom
// * @return
// */
// @AutoLog(value = "app_scene_cost_material_bom-编辑")
// @ApiOperation(value = "app_scene_cost_material_bom-编辑", notes = "app_scene_cost_material_bom-编辑")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:edit")
// @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
// public Result<String> edit(@RequestBody AppSceneCostMaterialBom appSceneCostMaterialBom) {
// appSceneCostMaterialBomService.updateById(appSceneCostMaterialBom);
// return Result.OK("编辑成功!");
// }
//
// /**
// * 通过id删除
// *
// * @param id
// * @return
// */
// @AutoLog(value = "app_scene_cost_material_bom-通过id删除")
// @ApiOperation(value = "app_scene_cost_material_bom-通过id删除", notes = "app_scene_cost_material_bom-通过id删除")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:delete")
// @DeleteMapping(value = "/delete")
// public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
// appSceneCostMaterialBomService.removeById(id);
// return Result.OK("删除成功!");
// }
//
// /**
// * 批量删除
// *
// * @param ids
// * @return
// */
// @AutoLog(value = "app_scene_cost_material_bom-批量删除")
// @ApiOperation(value = "app_scene_cost_material_bom-批量删除", notes = "app_scene_cost_material_bom-批量删除")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:deleteBatch")
// @DeleteMapping(value = "/deleteBatch")
// public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
// this.appSceneCostMaterialBomService.removeByIds(Arrays.asList(ids.split(",")));
// return Result.OK("批量删除成功!");
// }
//
// /**
// * 通过id查询
// *
// * @param id
// * @return
// */
// //@AutoLog(value = "app_scene_cost_material_bom-通过id查询")
// @ApiOperation(value = "app_scene_cost_material_bom-通过id查询", notes = "app_scene_cost_material_bom-通过id查询")
// @GetMapping(value = "/queryById")
// public Result<AppSceneCostMaterialBom> queryById(@RequestParam(name = "id", required = true) String id) {
// AppSceneCostMaterialBom appSceneCostMaterialBom = appSceneCostMaterialBomService.getById(id);
// if (appSceneCostMaterialBom == null) {
// return Result.error("未找到对应数据");
// }
// return Result.OK(appSceneCostMaterialBom);
// }
//
// /**
// * 导出excel
// *
// * @param request
// * @param appSceneCostMaterialBom
// */
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:exportXls")
// @RequestMapping(value = "/exportXls")
// public ModelAndView exportXls(HttpServletRequest request, AppSceneCostMaterialBom appSceneCostMaterialBom) {
// return super.exportXls(request, appSceneCostMaterialBom, AppSceneCostMaterialBom.class, "app_scene_cost_material_bom");
// }
//
// /**
// * 通过excel导入数据
// *
// * @param request
// * @param response
// * @return
// */
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_bom:importExcel")
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
// public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
// return super.importExcel(request, response, AppSceneCostMaterialBom.class);
// }
}
@@ -0,0 +1,159 @@
package com.zzsmart.qomo.kn.cost.manage.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialProcessHours;
import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostMaterialProcessHoursService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: app_scene_cost_material_process_hours
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
@Api(tags = "cost-工序工时")
@RestController
@RequestMapping("//processHours")
@Slf4j
public class AppSceneCostMaterialProcessHoursController extends JeecgController<AppSceneCostMaterialProcessHours, IAppSceneCostMaterialProcessHoursService> {
@Autowired
private IAppSceneCostMaterialProcessHoursService appSceneCostMaterialProcessHoursService;
/**
* 分页列表查询
*
* @param appSceneCostMaterialProcessHours
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "app_scene_cost_material_process_hours-分页列表查询")
@ApiOperation(value = "app_scene_cost_material_process_hours-分页列表查询", notes = "app_scene_cost_material_process_hours-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppSceneCostMaterialProcessHours>> queryPageList(AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
QueryWrapper<AppSceneCostMaterialProcessHours> queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostMaterialProcessHours, req.getParameterMap());
Page<AppSceneCostMaterialProcessHours> page = new Page<AppSceneCostMaterialProcessHours>(pageNo, pageSize);
IPage<AppSceneCostMaterialProcessHours> pageList = appSceneCostMaterialProcessHoursService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param appSceneCostMaterialProcessHours
* @return
*/
@AutoLog(value = "app_scene_cost_material_process_hours-添加")
@ApiOperation(value = "app_scene_cost_material_process_hours-添加", notes = "app_scene_cost_material_process_hours-添加")
//@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours) {
appSceneCostMaterialProcessHoursService.save(appSceneCostMaterialProcessHours);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param appSceneCostMaterialProcessHours
* @return
*/
@AutoLog(value = "app_scene_cost_material_process_hours-编辑")
@ApiOperation(value = "app_scene_cost_material_process_hours-编辑", notes = "app_scene_cost_material_process_hours-编辑")
//@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours) {
appSceneCostMaterialProcessHoursService.updateById(appSceneCostMaterialProcessHours);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "app_scene_cost_material_process_hours-通过id删除")
@ApiOperation(value = "app_scene_cost_material_process_hours-通过id删除", notes = "app_scene_cost_material_process_hours-通过id删除")
//@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
appSceneCostMaterialProcessHoursService.removeById(id);
return Result.OK("删除成功!");
}
// /**
// * 批量删除
// *
// * @param ids
// * @return
// */
// @AutoLog(value = "app_scene_cost_material_process_hours-批量删除")
// @ApiOperation(value = "app_scene_cost_material_process_hours-批量删除", notes = "app_scene_cost_material_process_hours-批量删除")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:deleteBatch")
// @DeleteMapping(value = "/deleteBatch")
// public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
// this.appSceneCostMaterialProcessHoursService.removeByIds(Arrays.asList(ids.split(",")));
// return Result.OK("批量删除成功!");
// }
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "app_scene_cost_material_process_hours-通过id查询")
@ApiOperation(value = "app_scene_cost_material_process_hours-通过id查询", notes = "app_scene_cost_material_process_hours-通过id查询")
@GetMapping(value = "/queryById")
public Result<AppSceneCostMaterialProcessHours> queryById(@RequestParam(name = "id", required = true) String id) {
AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours = appSceneCostMaterialProcessHoursService.getById(id);
if (appSceneCostMaterialProcessHours == null) {
return Result.error("未找到对应数据");
}
return Result.OK(appSceneCostMaterialProcessHours);
}
// /**
// * 导出excel
// *
// * @param request
// * @param appSceneCostMaterialProcessHours
// */
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:exportXls")
// @RequestMapping(value = "/exportXls")
// public ModelAndView exportXls(HttpServletRequest request, AppSceneCostMaterialProcessHours appSceneCostMaterialProcessHours) {
// return super.exportXls(request, appSceneCostMaterialProcessHours, AppSceneCostMaterialProcessHours.class, "app_scene_cost_material_process_hours");
// }
// /**
// * 通过excel导入数据
// *
// * @param request
// * @param response
// * @return
// */
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_material_process_hours:importExcel")
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
// public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
// return super.importExcel(request, response, AppSceneCostMaterialProcessHours.class);
// }
}
@@ -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.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.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
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.setCreateTime(new Date());
flowDefinition.setUpdateTime(new Date());
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-编辑")
@PostMapping(value = "/edit")
public Result<FlowDefinition> edit(@RequestBody FlowDefinition flowDefinition) {
flowDefinition.setUpdateTime(new Date());
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删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) Integer id) {
flowDefinitionService.delete(id);
return Result.OK("删除成功!");
}
}
@@ -0,0 +1,159 @@
package com.zzsmart.qomo.kn.cost.manage.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPartMissingInfo;
import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPartMissingInfoService;
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_part_missing_info
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
@Api(tags = "cost-部件缺失信息")
@RestController
@RequestMapping("//partMissingInfo")
@Slf4j
public class AppSceneCostPartMissingInfoController extends JeecgController<AppSceneCostPartMissingInfo, IAppSceneCostPartMissingInfoService> {
@Autowired
private IAppSceneCostPartMissingInfoService appSceneCostPartMissingInfoService;
/**
* 分页列表查询
*
* @param appSceneCostPartMissingInfo
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@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<AppSceneCostPartMissingInfo>> queryPageList(AppSceneCostPartMissingInfo appSceneCostPartMissingInfo, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
QueryWrapper<AppSceneCostPartMissingInfo> queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostPartMissingInfo, req.getParameterMap());
Page<AppSceneCostPartMissingInfo> page = new Page<AppSceneCostPartMissingInfo>(pageNo, pageSize);
IPage<AppSceneCostPartMissingInfo> pageList = appSceneCostPartMissingInfoService.page(page, queryWrapper);
return Result.OK(pageList);
}
//
// /**
// * 添加
// *
// * @param appSceneCostPartMissingInfo
// * @return
// */
// @AutoLog(value = "app_scene_cost_part_missing_info-添加")
// @ApiOperation(value = "app_scene_cost_part_missing_info-添加", notes = "app_scene_cost_part_missing_info-添加")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_part_missing_info:add")
// @PostMapping(value = "/add")
// public Result<String> add(@RequestBody AppSceneCostPartMissingInfo appSceneCostPartMissingInfo) {
// appSceneCostPartMissingInfoService.save(appSceneCostPartMissingInfo);
// return Result.OK("添加成功!");
// }
//
// /**
// * 编辑
// *
// * @param appSceneCostPartMissingInfo
// * @return
// */
// @AutoLog(value = "app_scene_cost_part_missing_info-编辑")
// @ApiOperation(value = "app_scene_cost_part_missing_info-编辑", notes = "app_scene_cost_part_missing_info-编辑")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_part_missing_info:edit")
// @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
// public Result<String> edit(@RequestBody AppSceneCostPartMissingInfo appSceneCostPartMissingInfo) {
// appSceneCostPartMissingInfoService.updateById(appSceneCostPartMissingInfo);
// return Result.OK("编辑成功!");
// }
//
// /**
// * 通过id删除
// *
// * @param id
// * @return
// */
// @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("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_part_missing_info:delete")
// @DeleteMapping(value = "/delete")
// public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
// appSceneCostPartMissingInfoService.removeById(id);
// return Result.OK("删除成功!");
// }
//
// /**
// * 批量删除
// *
// * @param ids
// * @return
// */
// @AutoLog(value = "app_scene_cost_part_missing_info-批量删除")
// @ApiOperation(value = "app_scene_cost_part_missing_info-批量删除", notes = "app_scene_cost_part_missing_info-批量删除")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_part_missing_info:deleteBatch")
// @DeleteMapping(value = "/deleteBatch")
// public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
// this.appSceneCostPartMissingInfoService.removeByIds(Arrays.asList(ids.split(",")));
// return Result.OK("批量删除成功!");
// }
//
// /**
// * 通过id查询
// *
// * @param id
// * @return
// */
// //@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<AppSceneCostPartMissingInfo> queryById(@RequestParam(name = "id", required = true) String id) {
// AppSceneCostPartMissingInfo appSceneCostPartMissingInfo = appSceneCostPartMissingInfoService.getById(id);
// if (appSceneCostPartMissingInfo == null) {
// return Result.error("未找到对应数据");
// }
// return Result.OK(appSceneCostPartMissingInfo);
// }
//
// /**
// * 导出excel
// *
// * @param request
// * @param appSceneCostPartMissingInfo
// */
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_part_missing_info:exportXls")
// @RequestMapping(value = "/exportXls")
// public ModelAndView exportXls(HttpServletRequest request, AppSceneCostPartMissingInfo appSceneCostPartMissingInfo) {
// return super.exportXls(request, appSceneCostPartMissingInfo, AppSceneCostPartMissingInfo.class, "app_scene_cost_part_missing_info");
// }
//
// /**
// * 通过excel导入数据
// *
// * @param request
// * @param response
// * @return
// */
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage: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, AppSceneCostPartMissingInfo.class);
// }
}
@@ -0,0 +1,162 @@
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.AppSceneCostPurchaseEvaluate;
import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchaseEvaluateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: app_scene_cost_purchase_evaluate
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
@Api(tags = "cost-采购合同")
@RestController
@RequestMapping("//PurchaseEvaluate")
@Slf4j
public class AppSceneCostPurchaseEvaluateController extends JeecgController<AppSceneCostPurchaseEvaluate, IAppSceneCostPurchaseEvaluateService> {
@Autowired
private IAppSceneCostPurchaseEvaluateService appSceneCostPurchaseEvaluateService;
/**
* 分页列表查询
*
* @param appSceneCostPurchaseEvaluate
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "app_scene_cost_purchase_evaluate-分页列表查询")
@ApiOperation(value = "app_scene_cost_purchase_evaluate-分页列表查询", notes = "app_scene_cost_purchase_evaluate-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppSceneCostPurchaseEvaluate>> queryPageList(AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AppSceneCostPurchaseEvaluate> queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostPurchaseEvaluate, req.getParameterMap());
Page<AppSceneCostPurchaseEvaluate> page = new Page<AppSceneCostPurchaseEvaluate>(pageNo, pageSize);
IPage<AppSceneCostPurchaseEvaluate> pageList = appSceneCostPurchaseEvaluateService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param appSceneCostPurchaseEvaluate
* @return
*/
@AutoLog(value = "app_scene_cost_purchase_evaluate-添加")
@ApiOperation(value = "app_scene_cost_purchase_evaluate-添加", notes = "app_scene_cost_purchase_evaluate-添加")
//@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate) {
appSceneCostPurchaseEvaluateService.save(appSceneCostPurchaseEvaluate);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param appSceneCostPurchaseEvaluate
* @return
*/
@AutoLog(value = "app_scene_cost_purchase_evaluate-编辑")
@ApiOperation(value = "app_scene_cost_purchase_evaluate-编辑", notes = "app_scene_cost_purchase_evaluate-编辑")
//@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate) {
appSceneCostPurchaseEvaluateService.updateById(appSceneCostPurchaseEvaluate);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "app_scene_cost_purchase_evaluate-通过id删除")
@ApiOperation(value = "app_scene_cost_purchase_evaluate-通过id删除", notes = "app_scene_cost_purchase_evaluate-通过id删除")
//@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
appSceneCostPurchaseEvaluateService.removeById(id);
return Result.OK("删除成功!");
}
//
// /**
// * 批量删除
// *
// * @param ids
// * @return
// */
// @AutoLog(value = "app_scene_cost_purchase_evaluate-批量删除")
// @ApiOperation(value = "app_scene_cost_purchase_evaluate-批量删除", notes = "app_scene_cost_purchase_evaluate-批量删除")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:deleteBatch")
// @DeleteMapping(value = "/deleteBatch")
// public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
// this.appSceneCostPurchaseEvaluateService.removeByIds(Arrays.asList(ids.split(",")));
// return Result.OK("批量删除成功!");
// }
//
// /**
// * 通过id查询
// *
// * @param id
// * @return
// */
// //@AutoLog(value = "app_scene_cost_purchase_evaluate-通过id查询")
// @ApiOperation(value = "app_scene_cost_purchase_evaluate-通过id查询", notes = "app_scene_cost_purchase_evaluate-通过id查询")
// @GetMapping(value = "/queryById")
// public Result<AppSceneCostPurchaseEvaluate> queryById(@RequestParam(name = "id", required = true) String id) {
// AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate = appSceneCostPurchaseEvaluateService.getById(id);
// if (appSceneCostPurchaseEvaluate == null) {
// return Result.error("未找到对应数据");
// }
// return Result.OK(appSceneCostPurchaseEvaluate);
// }
//
// /**
// * 导出excel
// *
// * @param request
// * @param appSceneCostPurchaseEvaluate
// */
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:exportXls")
// @RequestMapping(value = "/exportXls")
// public ModelAndView exportXls(HttpServletRequest request, AppSceneCostPurchaseEvaluate appSceneCostPurchaseEvaluate) {
// return super.exportXls(request, appSceneCostPurchaseEvaluate, AppSceneCostPurchaseEvaluate.class, "app_scene_cost_purchase_evaluate");
// }
//
// /**
// * 通过excel导入数据
// *
// * @param request
// * @param response
// * @return
// */
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_evaluate:importExcel")
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
// public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
// return super.importExcel(request, response, AppSceneCostPurchaseEvaluate.class);
// }
}
@@ -0,0 +1,159 @@
package com.zzsmart.qomo.kn.cost.manage.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchasePrice;
import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostPurchasePriceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: app_scene_cost_purchase_price
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
@Api(tags = "cost-采购价")
@RestController
@RequestMapping("//purchasePrice")
@Slf4j
public class AppSceneCostPurchasePriceController extends JeecgController<AppSceneCostPurchasePrice, IAppSceneCostPurchasePriceService> {
@Autowired
private IAppSceneCostPurchasePriceService appSceneCostPurchasePriceService;
/**
* 分页列表查询
*
* @param appSceneCostPurchasePrice
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "app_scene_cost_purchase_price-分页列表查询")
@ApiOperation(value = "app_scene_cost_purchase_price-分页列表查询", notes = "app_scene_cost_purchase_price-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppSceneCostPurchasePrice>> queryPageList(AppSceneCostPurchasePrice appSceneCostPurchasePrice, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
QueryWrapper<AppSceneCostPurchasePrice> queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostPurchasePrice, req.getParameterMap());
Page<AppSceneCostPurchasePrice> page = new Page<AppSceneCostPurchasePrice>(pageNo, pageSize);
IPage<AppSceneCostPurchasePrice> pageList = appSceneCostPurchasePriceService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param appSceneCostPurchasePrice
* @return
*/
@AutoLog(value = "app_scene_cost_purchase_price-添加")
@ApiOperation(value = "app_scene_cost_purchase_price-添加", notes = "app_scene_cost_purchase_price-添加")
//@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody AppSceneCostPurchasePrice appSceneCostPurchasePrice) {
appSceneCostPurchasePriceService.save(appSceneCostPurchasePrice);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param appSceneCostPurchasePrice
* @return
*/
@AutoLog(value = "app_scene_cost_purchase_price-编辑")
@ApiOperation(value = "app_scene_cost_purchase_price-编辑", notes = "app_scene_cost_purchase_price-编辑")
//@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody AppSceneCostPurchasePrice appSceneCostPurchasePrice) {
appSceneCostPurchasePriceService.updateById(appSceneCostPurchasePrice);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "app_scene_cost_purchase_price-通过id删除")
@ApiOperation(value = "app_scene_cost_purchase_price-通过id删除", notes = "app_scene_cost_purchase_price-通过id删除")
//@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
appSceneCostPurchasePriceService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "app_scene_cost_purchase_price-批量删除")
@ApiOperation(value = "app_scene_cost_purchase_price-批量删除", notes = "app_scene_cost_purchase_price-批量删除")
//@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.appSceneCostPurchasePriceService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "app_scene_cost_purchase_price-通过id查询")
@ApiOperation(value = "app_scene_cost_purchase_price-通过id查询", notes = "app_scene_cost_purchase_price-通过id查询")
@GetMapping(value = "/queryById")
public Result<AppSceneCostPurchasePrice> queryById(@RequestParam(name = "id", required = true) String id) {
AppSceneCostPurchasePrice appSceneCostPurchasePrice = appSceneCostPurchasePriceService.getById(id);
if (appSceneCostPurchasePrice == null) {
return Result.error("未找到对应数据");
}
return Result.OK(appSceneCostPurchasePrice);
}
/**
* 导出excel
*
* @param request
* @param appSceneCostPurchasePrice
*/
//@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, AppSceneCostPurchasePrice appSceneCostPurchasePrice) {
return super.exportXls(request, appSceneCostPurchasePrice, AppSceneCostPurchasePrice.class, "app_scene_cost_purchase_price");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
//@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_purchase_price:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, AppSceneCostPurchasePrice.class);
}
}
@@ -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);
}
}
@@ -0,0 +1,160 @@
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.AppSceneCostStandardDetail;
import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardDetailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
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.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
/**
* @Description: app_scene_cost_standard_detail
* @Author: jeecg-boot
* @Date: 2024-07-31
* @Version: V1.0
*/
@Api(tags = "cost-标准成本单行查询")
@RestController
@RequestMapping("//costStandardDetail")
@Slf4j
public class AppSceneCostStandardDetailController extends JeecgController<AppSceneCostStandardDetail, IAppSceneCostStandardDetailService> {
@Autowired
private IAppSceneCostStandardDetailService appSceneCostStandardDetailService;
/**
* 分页列表查询
*
* @param appSceneCostStandardDetail
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "app_scene_cost_standard_detail-分页列表查询")
@ApiOperation(value = "app_scene_cost_standard_detail-分页列表查询", notes = "app_scene_cost_standard_detail-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppSceneCostStandardDetail>> queryPageList(AppSceneCostStandardDetail appSceneCostStandardDetail, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
QueryWrapper<AppSceneCostStandardDetail> queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostStandardDetail, req.getParameterMap());
Page<AppSceneCostStandardDetail> page = new Page<AppSceneCostStandardDetail>(pageNo, pageSize);
IPage<AppSceneCostStandardDetail> pageList = appSceneCostStandardDetailService.page(page, queryWrapper);
return Result.OK(pageList);
}
//
// /**
// * 添加
// *
// * @param appSceneCostStandardDetail
// * @return
// */
// @AutoLog(value = "app_scene_cost_standard_detail-添加")
// @ApiOperation(value = "app_scene_cost_standard_detail-添加", notes = "app_scene_cost_standard_detail-添加")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_detail:add")
// @PostMapping(value = "/add")
// public Result<String> add(@RequestBody AppSceneCostStandardDetail appSceneCostStandardDetail) {
// appSceneCostStandardDetailService.save(appSceneCostStandardDetail);
// return Result.OK("添加成功!");
// }
// /**
// * 编辑
// *
// * @param appSceneCostStandardDetail
// * @return
// */
// @AutoLog(value = "app_scene_cost_standard_detail-编辑")
// @ApiOperation(value = "app_scene_cost_standard_detail-编辑", notes = "app_scene_cost_standard_detail-编辑")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_detail:edit")
// @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
// public Result<String> edit(@RequestBody AppSceneCostStandardDetail appSceneCostStandardDetail) {
// appSceneCostStandardDetailService.updateById(appSceneCostStandardDetail);
// return Result.OK("编辑成功!");
// }
//
// /**
// * 通过id删除
// *
// * @param id
// * @return
// */
// @AutoLog(value = "app_scene_cost_standard_detail-通过id删除")
// @ApiOperation(value = "app_scene_cost_standard_detail-通过id删除", notes = "app_scene_cost_standard_detail-通过id删除")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_detail:delete")
// @DeleteMapping(value = "/delete")
// public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
// appSceneCostStandardDetailService.removeById(id);
// return Result.OK("删除成功!");
// }
//
// /**
// * 批量删除
// *
// * @param ids
// * @return
// */
// @AutoLog(value = "app_scene_cost_standard_detail-批量删除")
// @ApiOperation(value = "app_scene_cost_standard_detail-批量删除", notes = "app_scene_cost_standard_detail-批量删除")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_detail:deleteBatch")
// @DeleteMapping(value = "/deleteBatch")
// public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
// this.appSceneCostStandardDetailService.removeByIds(Arrays.asList(ids.split(",")));
// return Result.OK("批量删除成功!");
// }
// /**
// * 通过id查询
// *
// * @param id
// * @return
// */
// //@AutoLog(value = "app_scene_cost_standard_detail-通过id查询")
// @ApiOperation(value = "app_scene_cost_standard_detail-通过id查询", notes = "app_scene_cost_standard_detail-通过id查询")
// @GetMapping(value = "/queryById")
// public Result<AppSceneCostStandardDetail> queryById(@RequestParam(name = "id", required = true) String id) {
// AppSceneCostStandardDetail appSceneCostStandardDetail = appSceneCostStandardDetailService.getById(id);
// if (appSceneCostStandardDetail == null) {
// return Result.error("未找到对应数据");
// }
// return Result.OK(appSceneCostStandardDetail);
// }
/**
* 导出excel
*
* @param request
* @param appSceneCostStandardDetail
*/
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_detail:exportXls")
@RequestMapping(value = "/exportXls")
@ApiOperation(value = "cost-单行查询导出", notes = "cost-单行查询导出")
public ModelAndView exportXls(HttpServletRequest request, AppSceneCostStandardDetail appSceneCostStandardDetail) {
return super.exportXls(request, appSceneCostStandardDetail, AppSceneCostStandardDetail.class, "app_scene_cost_standard_detail");
}
// /**
// * 通过excel导入数据
// *
// * @param request
// * @param response
// * @return
// */
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_detail:importExcel")
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
// public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
// return super.importExcel(request, response, AppSceneCostStandardDetail.class);
// }
}
@@ -0,0 +1,157 @@
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.AppSceneCostStandardVersion;
import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardVersionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: app_scene_cost_standard_version
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
@Api(tags = "cost-标准成本-版本号")
@RestController
@RequestMapping("//costStandardVersion")
public class AppSceneCostStandardVersionController extends JeecgController<AppSceneCostStandardVersion, IAppSceneCostStandardVersionService> {
@Autowired
private IAppSceneCostStandardVersionService appSceneCostStandardVersionService;
/**
* 分页列表查询
*
* @param appSceneCostStandardVersion
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "app_scene_cost_standard_version-分页列表查询")
@ApiOperation(value = "app_scene_cost_standard_version-分页列表查询", notes = "app_scene_cost_standard_version-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<AppSceneCostStandardVersion>> queryPageList(AppSceneCostStandardVersion appSceneCostStandardVersion, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
QueryWrapper<AppSceneCostStandardVersion> queryWrapper = QueryGenerator.initQueryWrapper(appSceneCostStandardVersion, req.getParameterMap());
Page<AppSceneCostStandardVersion> page = new Page<AppSceneCostStandardVersion>(pageNo, pageSize);
IPage<AppSceneCostStandardVersion> pageList = appSceneCostStandardVersionService.page(page, queryWrapper);
return Result.OK(pageList);
}
// /**
// * 添加
// *
// * @param appSceneCostStandardVersion
// * @return
// */
// @AutoLog(value = "app_scene_cost_standard_version-添加")
// @ApiOperation(value = "app_scene_cost_standard_version-添加", notes = "app_scene_cost_standard_version-添加")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_version:add")
// @PostMapping(value = "/add")
// public Result<String> add(@RequestBody AppSceneCostStandardVersion appSceneCostStandardVersion) {
// appSceneCostStandardVersionService.save(appSceneCostStandardVersion);
// return Result.OK("添加成功!");
// }
//
// /**
// * 编辑
// *
// * @param appSceneCostStandardVersion
// * @return
// */
// @AutoLog(value = "app_scene_cost_standard_version-编辑")
// @ApiOperation(value = "app_scene_cost_standard_version-编辑", notes = "app_scene_cost_standard_version-编辑")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_version:edit")
// @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
// public Result<String> edit(@RequestBody AppSceneCostStandardVersion appSceneCostStandardVersion) {
// appSceneCostStandardVersionService.updateById(appSceneCostStandardVersion);
// return Result.OK("编辑成功!");
// }
//
// /**
// * 通过id删除
// *
// * @param id
// * @return
// */
// @AutoLog(value = "app_scene_cost_standard_version-通过id删除")
// @ApiOperation(value = "app_scene_cost_standard_version-通过id删除", notes = "app_scene_cost_standard_version-通过id删除")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_version:delete")
// @DeleteMapping(value = "/delete")
// public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
// appSceneCostStandardVersionService.removeById(id);
// return Result.OK("删除成功!");
// }
//
// /**
// * 批量删除
// *
// * @param ids
// * @return
// */
// @AutoLog(value = "app_scene_cost_standard_version-批量删除")
// @ApiOperation(value = "app_scene_cost_standard_version-批量删除", notes = "app_scene_cost_standard_version-批量删除")
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_version:deleteBatch")
// @DeleteMapping(value = "/deleteBatch")
// public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
// this.appSceneCostStandardVersionService.removeByIds(Arrays.asList(ids.split(",")));
// return Result.OK("批量删除成功!");
// }
//
// /**
// * 通过id查询
// *
// * @param id
// * @return
// */
// //@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<AppSceneCostStandardVersion> queryById(@RequestParam(name = "id", required = true) String id) {
// AppSceneCostStandardVersion appSceneCostStandardVersion = appSceneCostStandardVersionService.getById(id);
// if (appSceneCostStandardVersion == null) {
// return Result.error("未找到对应数据");
// }
// return Result.OK(appSceneCostStandardVersion);
// }
//
// /**
// * 导出excel
// *
// * @param request
// * @param appSceneCostStandardVersion
// */
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_version:exportXls")
// @RequestMapping(value = "/exportXls")
// public ModelAndView exportXls(HttpServletRequest request, AppSceneCostStandardVersion appSceneCostStandardVersion) {
// return super.exportXls(request, appSceneCostStandardVersion, AppSceneCostStandardVersion.class, "app_scene_cost_standard_version");
// }
//
// /**
// * 通过excel导入数据
// *
// * @param request
// * @param response
// * @return
// */
// //@RequiresPermissions("com.zzsmart.qomo.kn.cost.manage:app_scene_cost_standard_version:importExcel")
// @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
// public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
// return super.importExcel(request, response, AppSceneCostStandardVersion.class);
// }
}
@@ -0,0 +1,31 @@
package com.zzsmart.qomo.kn.cost.manage.controller;
import com.zzsmart.qomo.kn.cost.manage.service.BomTreeService;
import com.zzsmart.qomo.kn.cost.manage.vo.BomTreeInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
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 java.util.List;
@Api(tags = "cost-结构树查询")
@RestController
@RequestMapping("//bomTree")
@Slf4j
public class BomTreeController {
@Autowired
BomTreeService bomTreeService;
@ApiOperation(value = "结构树查询", notes = "结构树查询")
@GetMapping(value = "/queryBomTree")
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);
}
}
@@ -0,0 +1,106 @@
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.*;
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_count
* @Author: jeecg-boot
* @Date: 2024-07-29
* @Version: V1.0
*/
@Data
@TableName("app_scene_cost_count")
@Builder
@NoArgsConstructor
@AllArgsConstructor
@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 = "阶段", width = 15)
@ApiModelProperty(value = "stage")
private String stage;
/**
* 标准成本计算流程id
*/
@Excel(name = "标准成本计算流程id", width = 15)
@ApiModelProperty(value = "标准成本计算流程id")
private Integer flowDefinitionId;
/**
* year
*/
@Excel(name = "年份", 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,114 @@
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.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.math.BigDecimal;
import java.util.Date;
/**
* @Description: app_scene_cost_hour_rate
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
@Data
@TableName("app_scene_cost_hour_rate")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "app_scene_cost_hour_rate对象", description = "app_scene_cost_hour_rate")
public class AppSceneCostHourRate implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**
* 年度
*/
@Excel(name = "年度", width = 15)
@ApiModelProperty(value = "年度")
private String year;
/**
* 成本中心代码
*/
@Excel(name = "成本中心代码", width = 15)
@ApiModelProperty(value = "成本中心代码")
private String costCenterCode;
/**
* 工厂代码
*/
@Excel(name = "工厂代码", width = 15)
@ApiModelProperty(value = "工厂代码")
private String factory;
/**
* 人工小时费率
*/
@Excel(name = "人工小时费率", width = 15)
@ApiModelProperty(value = "人工小时费率")
private BigDecimal laborHourRate;
/**
* 设备小时费率
*/
@Excel(name = "设备小时费率", width = 15)
@ApiModelProperty(value = "设备小时费率")
private BigDecimal equipHourRate;
/**
* 燃动小时费率
*/
@Excel(name = "燃动小时费率", width = 15)
@ApiModelProperty(value = "燃动小时费率")
private BigDecimal fuelHourRate;
/**
* 辅料小时费率
*/
@Excel(name = "辅料小时费率", width = 15)
@ApiModelProperty(value = "辅料小时费率")
private BigDecimal auxiliaryHourRate;
/**
* 其他小时费率
*/
@Excel(name = "其他小时费率", width = 15)
@ApiModelProperty(value = "其他小时费率")
private BigDecimal otherHourRate;
/**
* 生效日期
*/
@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 effectiveDate;
/**
* 失效日期
*/
@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 expirationDate;
/**
* 维护人员
*/
@Excel(name = "维护人员", width = 15)
@ApiModelProperty(value = "维护人员")
private String guardian;
/**
* 维护时间
*/
@Excel(name = "维护时间", width = 15)
@ApiModelProperty(value = "维护时间")
private String maintenanceTime;
}
@@ -0,0 +1,261 @@
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.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.math.BigDecimal;
import java.util.Date;
/**
* @Description: app_scene_cost_material_bom
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
@Data
@TableName("app_scene_cost_material_bom")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "app_scene_cost_material_bom对象", description = "app_scene_cost_material_bom")
public class AppSceneCostMaterialBom 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 materialCode;
/**
* 物料名称
*/
@Excel(name = "物料名称", width = 15)
@ApiModelProperty(value = "物料名称")
private String materialName;
/**
* 父级物料编码
*/
@Excel(name = "父级物料编码", width = 15)
@ApiModelProperty(value = "父级物料编码")
private String parentMaterialCode;
/**
* 级别
*/
@Excel(name = "级别", width = 15)
@ApiModelProperty(value = "级别")
private String level;
/**
* 排序
*/
@Excel(name = "排序", width = 15)
@ApiModelProperty(value = "排序")
private Integer sort;
/**
* 计量单位
*/
@Excel(name = "计量单位", width = 15)
@ApiModelProperty(value = "计量单位")
private String unit;
/**
* 数量
*/
@Excel(name = "数量", width = 15)
@ApiModelProperty(value = "数量")
private Integer number;
/**
* 人工工时(分钟)
*/
@Excel(name = "人工工时(分钟)", width = 15)
@ApiModelProperty(value = "人工工时(分钟)")
private BigDecimal laborHours;
/**
* 设备工时
*/
@Excel(name = "设备工时", width = 15)
@ApiModelProperty(value = "设备工时")
private BigDecimal deviceHours;
/**
* 借用物料编码
*/
@Excel(name = "借用物料编码", width = 15)
@ApiModelProperty(value = "借用物料编码")
private String borrowMaterialCode;
/**
* 参考物料编码
*/
@Excel(name = "参考物料编码", width = 15)
@ApiModelProperty(value = "参考物料编码")
private String referMaterialCode;
/**
* 采购类型
*/
@Excel(name = "采购类型", width = 15)
@ApiModelProperty(value = "采购类型")
private String purchaseType;
/**
* 特殊采购类型
*/
@Excel(name = "特殊采购类型", width = 15)
@ApiModelProperty(value = "特殊采购类型")
private String specialPurchaseType;
/**
* 说明
*/
@Excel(name = "说明", width = 15)
@ApiModelProperty(value = "说明")
private String explanation;
/**
* 单位数量
*/
@Excel(name = "单位数量", width = 15)
@ApiModelProperty(value = "单位数量")
private BigDecimal quantity;
/**
* 重量(g)
*/
@Excel(name = "重量(g)", width = 15)
@ApiModelProperty(value = "重量(g)")
private String weight;
/**
* 材料/牌号
*/
@Excel(name = "材料/牌号", width = 15)
@ApiModelProperty(value = "材料/牌号")
private String materialAndBrand;
/**
* 表面处理,材料
*/
@Excel(name = "表面处理,材料", width = 15)
@ApiModelProperty(value = "表面处理,材料")
private String surfaceMaterial;
/**
* 厚度(mm)
*/
@Excel(name = "厚度(mm)", width = 15)
@ApiModelProperty(value = "厚度(mm)")
private String surfaceThickness;
/**
* 表面积(mm²)
*/
@Excel(name = "表面积(mm²)", width = 15)
@ApiModelProperty(value = "表面积(mm²)")
private String surfaceArea;
/**
* 长(mm)
*/
@Excel(name = "长(mm)", width = 15)
@ApiModelProperty(value = "长(mm)")
private String length;
/**
* 宽(mm)
*/
@Excel(name = "宽(mm)", width = 15)
@ApiModelProperty(value = "宽(mm)")
private String width;
/**
* 高(mm)
*/
@Excel(name = "高(mm)", width = 15)
@ApiModelProperty(value = "高(mm)")
private String height;
/**
* 图示/图档/文档 文件ID
*/
@Excel(name = "图示/图档/文档 文件ID", width = 15)
@ApiModelProperty(value = "图示/图档/文档 文件ID")
private Integer figureFileId;
/**
* 是否新摸具(0否 1是)
*/
@Excel(name = "是否新摸具(0否 1是)", width = 15)
@ApiModelProperty(value = "是否新摸具(0否 1是)")
private Integer newTooling;
/**
* 成型方式(枚举)
*/
@Excel(name = "成型方式(枚举)", width = 15)
@ApiModelProperty(value = "成型方式(枚举)")
private String shapingMethod;
/**
* 作业内容
*/
@Excel(name = "作业内容", width = 15)
@ApiModelProperty(value = "作业内容")
private String workContent;
/**
* 加工地点
*/
@Excel(name = "加工地点", width = 15)
@ApiModelProperty(value = "加工地点")
private String processLocation;
/**
* 成本中心
*/
@Excel(name = "成本中心", width = 15)
@ApiModelProperty(value = "成本中心")
private String costCenter;
/**
* 单价(未税)
*/
@Excel(name = "单价(未税)", width = 15)
@ApiModelProperty(value = "单价(未税)")
private BigDecimal unitPrice;
/**
* 总价(未税)
*/
@Excel(name = "总价(未税)", width = 15)
@ApiModelProperty(value = "总价(未税)")
private BigDecimal totalPrice;
/**
* 摸具费(未税)
*/
@Excel(name = "摸具费(未税)", width = 15)
@ApiModelProperty(value = "摸具费(未税)")
private BigDecimal mouldPrice;
/**
* 创建人
*/
@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;
/**
* 修改人
*/
@ApiModelProperty(value = "修改人")
private String 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;
/**
* 备注(特殊技术信息)
*/
@Excel(name = "备注(特殊技术信息)", width = 15)
@ApiModelProperty(value = "备注(特殊技术信息)")
private String remark;
}
@@ -0,0 +1,129 @@
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.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.math.BigDecimal;
import java.util.Date;
/**
* @Description: app_scene_cost_material_process_hours
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
@Data
@TableName("app_scene_cost_material_process_hours")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "app_scene_cost_material_process_hours对象", description = "app_scene_cost_material_process_hours")
public class AppSceneCostMaterialProcessHours implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**
* 物料编码
*/
@Excel(name = "物料编码", width = 15)
@ApiModelProperty(value = "物料编码")
private String materialCode;
/**
* 物料名称
*/
@Excel(name = "物料名称", width = 15)
@ApiModelProperty(value = "物料名称")
private String materialName;
/**
* 层级
*/
@Excel(name = "层级", width = 15)
@ApiModelProperty(value = "层级")
private String level;
/**
* 数量
*/
@Excel(name = "数量", width = 15)
@ApiModelProperty(value = "数量")
private BigDecimal quantity;
/**
* 采购类型
*/
@Excel(name = "采购类型", width = 15)
@ApiModelProperty(value = "采购类型")
private String purchaseType;
/**
* 工序
*/
@Excel(name = "工序", width = 15)
@ApiModelProperty(value = "工序")
private String workProcess;
/**
* 描述
*/
@Excel(name = "描述", width = 15)
@ApiModelProperty(value = "描述")
private String described;
/**
* 人工工时
*/
@Excel(name = "人工工时", width = 15)
@ApiModelProperty(value = "人工工时")
private BigDecimal laborHours;
/**
* 设备工时
*/
@Excel(name = "设备工时", width = 15)
@ApiModelProperty(value = "设备工时")
private BigDecimal deviceHours;
/**
* 工作中心
*/
@Excel(name = "工作中心", width = 15)
@ApiModelProperty(value = "工作中心")
private String workCenter;
/**
* 创建人
*/
@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;
/**
* 修改人
*/
@ApiModelProperty(value = "修改人")
private String 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;
/**
* 备注
*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remark;
}
@@ -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,61 @@
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.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.io.Serializable;
/**
* @Description: app_scene_cost_part_missing_info
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
@Data
@Builder
@TableName("app_scene_cost_part_missing_info")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "app_scene_cost_part_missing_info对象", description = "app_scene_cost_part_missing_info")
public class AppSceneCostPartMissingInfo 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;
/**
* 版本号
*/
@Excel(name = "版本号", width = 15)
@ApiModelProperty(value = "版本号")
private String versionNumber;
/**
* 缺失信息
*/
@Excel(name = "缺失信息", width = 15)
@ApiModelProperty(value = "缺失信息")
private String missingInfo;
/**
* 标准成本表主键id
*/
@Excel(name = "标准成本表主键id", width = 15)
@ApiModelProperty(value = "标准成本表主键id")
private String costStandardId;
}
@@ -0,0 +1,86 @@
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_purchase_evaluate
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
@Data
@Builder
@TableName("app_scene_cost_purchase_evaluate")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "app_scene_cost_purchase_evaluate对象", description = "app_scene_cost_purchase_evaluate")
public class AppSceneCostPurchaseEvaluate 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 contractNo;
/**
* 估价
*/
@Excel(name = "估价", width = 15)
@ApiModelProperty(value = "估价")
private BigDecimal evaluate;
/**
* 合同名称
*/
@Excel(name = "合同名称", width = 15)
@ApiModelProperty(value = "合同名称")
private String contractName;
/**
* 创建时间
*/
@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;
/**
* 更新时间
*/
@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 Integer updateBy;
}
@@ -0,0 +1,173 @@
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.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.math.BigDecimal;
import java.util.Date;
/**
* @Description: app_scene_cost_purchase_price
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
@Data
@TableName("app_scene_cost_purchase_price")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "app_scene_cost_purchase_price对象", description = "app_scene_cost_purchase_price")
public class AppSceneCostPurchasePrice implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**
* 物料编码
*/
@Excel(name = "物料编码", width = 15)
@ApiModelProperty(value = "物料编码")
private String materialCode;
/**
* 物料名称
*/
@Excel(name = "物料名称", width = 15)
@ApiModelProperty(value = "物料名称")
private String materialName;
/**
* 规格型号
*/
@Excel(name = "规格型号", width = 15)
@ApiModelProperty(value = "规格型号")
private String specification;
/**
* 采购类型
*/
@Excel(name = "采购类型", width = 15)
@ApiModelProperty(value = "采购类型")
private String purchaseType;
/**
* 供应商代码
*/
@Excel(name = "供应商代码", width = 15)
@ApiModelProperty(value = "供应商代码")
private String supplierCode;
/**
* 供应商名称
*/
@Excel(name = "供应商名称", width = 15)
@ApiModelProperty(value = "供应商名称")
private String supplierName;
/**
* 采购价时间
*/
@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 purchasePriceTime;
/**
* 采购价合计
*/
@Excel(name = "采购价合计", width = 15)
@ApiModelProperty(value = "采购价合计")
private BigDecimal purchasePriceSum;
/**
* 最低采购单价
*/
@Excel(name = "最低采购单价", width = 15)
@ApiModelProperty(value = "最低采购单价")
private BigDecimal minPurchasePrice;
/**
* 最新采购单价
*/
@Excel(name = "最新采购单价", width = 15)
@ApiModelProperty(value = "最新采购单价")
private BigDecimal lastPurchasePrice;
/**
* 平均采购价
*/
@Excel(name = "平均采购价", width = 15)
@ApiModelProperty(value = "平均采购价")
private BigDecimal purchasePriceAvg;
/**
* 直接材料费
*/
@Excel(name = "直接材料费", width = 15)
@ApiModelProperty(value = "直接材料费")
private BigDecimal directMaterialCost;
/**
* 工艺加工费用
*/
@Excel(name = "工艺加工费用", width = 15)
@ApiModelProperty(value = "工艺加工费用")
private BigDecimal processCost;
/**
* 运输费用
*/
@Excel(name = "运输费用", width = 15)
@ApiModelProperty(value = "运输费用")
private BigDecimal transportCost;
/**
* 模具费用
*/
@Excel(name = "模具费用", width = 15)
@ApiModelProperty(value = "模具费用")
private BigDecimal mouldCost;
/**
* 其他费用
*/
@Excel(name = "其他费用", width = 15)
@ApiModelProperty(value = "其他费用")
private BigDecimal ortherCost;
/**
* 税率
*/
@Excel(name = "税率", width = 15)
@ApiModelProperty(value = "税率")
private BigDecimal taxTate;
/**
* 创建人
*/
@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;
/**
* 修改人
*/
@ApiModelProperty(value = "修改人")
private String 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;
/**
* 备注
*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remark;
}
@@ -0,0 +1,137 @@
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.math.BigDecimal;
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.AUTO)
@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;
/**
* 成本明细
*/
@Excel(name = "成本明细", width = 15)
@ApiModelProperty(value = "成本明细")
private String costDetail;
/**
* 单价或费率
*/
@Excel(name = "单价或费率", width = 15)
@ApiModelProperty(value = "单价或费率")
private BigDecimal priceOrRate;
/**
* 工时
*/
@Excel(name = "工时", width = 15)
@ApiModelProperty(value = "工时")
private BigDecimal hour;
}
@@ -0,0 +1,159 @@
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.math.BigDecimal;
import java.util.Date;
/**
* @Description: app_scene_cost_standard_detail
* @Author: jeecg-boot
* @Date: 2024-07-31
* @Version: V1.0
*/
@Data
@Builder
@TableName("app_scene_cost_standard_detail")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "app_scene_cost_standard_detail对象", description = "app_scene_cost_standard_detail")
public class AppSceneCostStandardDetail 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 figureNumber;
/**物料号,关联kn_new_sap_mara表matnr字段*/
@Excel(name = "物料号,关联kn_new_sap_mara表matnr字段", width = 15)
@ApiModelProperty(value = "物料号,关联kn_new_sap_mara表matnr字段")
private String materialNumber;
/**物料名称*/
@Excel(name = "物料名称", width = 15)
@ApiModelProperty(value = "物料名称")
private String materialName;
/**父类物料号*/
@Excel(name = "父类物料号", width = 15)
@ApiModelProperty(value = "父类物料号")
private String parentMaterialNumber;
/**版本号*/
@Excel(name = "版本号", width = 15)
@ApiModelProperty(value = "版本号")
private String versionNumber;
/**层级*/
@Excel(name = "层级", width = 15)
@ApiModelProperty(value = "层级")
private Integer level;
/**序号*/
@Excel(name = "序号", width = 15)
@ApiModelProperty(value = "序号")
private Integer sort;
/**用量*/
@Excel(name = "用量", width = 15)
@ApiModelProperty(value = "用量")
private Double dosage;
/**单位*/
@Excel(name = "单位", width = 15)
@ApiModelProperty(value = "单位")
private String unit;
/**本阶材料费*/
@Excel(name = "本阶材料费", width = 15)
@ApiModelProperty(value = "本阶材料费")
private BigDecimal materialCost;
/**本阶人工费*/
@Excel(name = "本阶人工陈本", width = 15)
@ApiModelProperty(value = "本阶人工成本")
private BigDecimal laborCost;
/**本阶辅料费*/
@Excel(name = "本阶辅料费", width = 15)
@ApiModelProperty(value = "本阶辅料费")
private BigDecimal supplyMaterialCost;
/**本阶机器折旧费*/
@Excel(name = "本阶机器折旧费", width = 15)
@ApiModelProperty(value = "本阶机器折旧费")
private BigDecimal equipmentCost;
/**本阶水电费(燃动费)*/
@Excel(name = "本阶水电费(燃动费)", width = 15)
@ApiModelProperty(value = "本阶水电费(燃动费)")
private BigDecimal driveCost;
/**本阶其他制造费*/
@Excel(name = "本阶其他费用", width = 15)
@ApiModelProperty(value = "本阶其他费用")
private BigDecimal otherCost;
/**本阶物流费*/
@Excel(name = "本阶物流费", width = 15)
@ApiModelProperty(value = "本阶物流费")
private BigDecimal logisticsCost;
/**累计物料成本*/
@Excel(name = "累计物料成本", width = 15)
@ApiModelProperty(value = "累计物料成本")
private BigDecimal totalMaterialCost;
/**累计人工成本*/
@Excel(name = "累计人工成本", width = 15)
@ApiModelProperty(value = "累计人工成本")
private BigDecimal totalLaborCost;
/**累计辅料费*/
@Excel(name = "累计辅料费", width = 15)
@ApiModelProperty(value = "累计辅料费")
private BigDecimal totalSupplyMaterialCost;
/**累计机器折旧费*/
@Excel(name = "累计机器折旧费", width = 15)
@ApiModelProperty(value = "累计机器折旧费")
private BigDecimal totalEquipmentCost;
/**累计水电费(燃动费)*/
@Excel(name = "累计水电费(燃动费)", width = 15)
@ApiModelProperty(value = "累计水电费(燃动费)")
private BigDecimal totalDriveCost;
/**累计其他费用*/
@Excel(name = "累计其他费用", width = 15)
@ApiModelProperty(value = "累计其他费用")
private BigDecimal totalOtherCost;
/**累计物流费用*/
@Excel(name = "累计物流费用", width = 15)
@ApiModelProperty(value = "累计物流费用")
private BigDecimal totalLogisticsCost;
/**本阶标准成本*/
@Excel(name = "本阶标准成本", width = 15)
@ApiModelProperty(value = "本阶标准成本")
private BigDecimal currentStandardCost;
/**累计标准成本*/
@Excel(name = "累计标准成本", width = 15)
@ApiModelProperty(value = "累计标准成本")
private BigDecimal totalStandardCost;
/**创建人*/
@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;
/**修改人*/
@ApiModelProperty(value = "修改人")
private String 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;
/**备注*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remark;
}
@@ -0,0 +1,106 @@
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_standard_version
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
@Data
@Builder
@TableName("app_scene_cost_standard_version")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "app_scene_cost_standard_version对象", description = "app_scene_cost_standard_version")
public class AppSceneCostStandardVersion 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 figureNumber;
/**
* 阶段,A-初始,B-首批,C-量产
*/
@Excel(name = "阶段,A-初始,B-首批,C-量产", width = 15)
@ApiModelProperty(value = "阶段,A-初始,B-首批,C-量产")
private String stage;
/**
* 物料号,关联kn_new_sap_mara表matnr字段
*/
@Excel(name = "物料号,关联kn_new_sap_mara表matnr字段", width = 15)
@ApiModelProperty(value = "物料号,关联kn_new_sap_mara表matnr字段")
private String materialNumber;
/**
* 版本号
*/
@Excel(name = "版本号", width = 15)
@ApiModelProperty(value = "版本号")
private String versionNumber;
/**
* 版本状态
*/
@Excel(name = "版本状态", width = 15)
@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")
@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")
@ApiModelProperty(value = "修改时间")
private Date updateTime;
/**
* 备注
*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remark;
/**
* 年份
*/
@Excel(name = "年份", width = 15)
@ApiModelProperty(value = "年份")
private String versionYear;
}
@@ -0,0 +1,73 @@
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 CostCountStatusEnum {
NotExecute("NotExecute", "未执行", 0), Executing("Executing", "计算中", 1), ExecutedFinished("ExecutedFinished", "计算完成", 2), ExecutedError("ExecutedError", "出错中止", 3);
private final String code;
private final String name;
private final Integer value;
CostCountStatusEnum(String code, String name, Integer value) {
this.code = code;
this.name = name;
this.value = value;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
public Integer getValue() {
return value;
}
/**
* 根据code获取text
*
* @param codeNo
* @return
*/
public static String getTextByCode(String codeNo) {
for (CostCountStatusEnum value : CostCountStatusEnum.values()) {
if (value.getCode().equals(codeNo)) {
return value.name();
}
}
return codeNo.toString();
}
public static String getTextByValue(Integer indexNo) {
for (CostCountStatusEnum value : CostCountStatusEnum.values()) {
if (value.getValue().equals(indexNo)) {
return value.name();
}
}
return indexNo.toString();
}
/**
* 根据text获取code
*
* @param name
* @return
*/
public static String getCodeByName(String name) {
for (CostCountStatusEnum value : CostCountStatusEnum.values()) {
if (value.name().equals(name)) {
return value.name();
}
}
return name;
}
}
@@ -0,0 +1,59 @@
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", "物流费"), StandardCost("StandardCost", "标准成本");
private final String code;
private final String name;
FeeTypeEnum(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
/**
* 根据code获取text
*
* @param codeNo
* @return
*/
public static String getTextByCode(String codeNo) {
for (FeeTypeEnum value : FeeTypeEnum.values()) {
if (value.getCode().equals(codeNo)) {
return value.name();
}
}
return codeNo.toString();
}
/**
* 根据text获取code
*
* @param name
* @return
*/
public static String getCodeByName(String name) {
for (FeeTypeEnum value : FeeTypeEnum.values()) {
if (value.name().equals(name)) {
return value.name();
}
}
return name;
}
}
@@ -0,0 +1,69 @@
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 HourOrRateTypeEnum {
LaborHour("LaborHour", "人员工时"),
LaborHourRate("LaborHourRate", "人员小时费率"),
MaterialUnitPrice("MaterialUnitPrice", "物料采购单价"),
EquipmentHour("EquipmentHour", "设备工时"),
EquipmentHourRate("EquipmentHourRate", "设备小时费率"),
SupplyMaterialHour("SupplyMaterialHour", "辅料工时"),
SupplyMaterialHourRate("SupplyMaterialHourRate", "辅料小时费率"),
DriverHour("DriverHour", "燃动工时"),
DriverHourRate("DriverHourRate", "燃动小时费率"),
OtherHour("OtherHour", "其他工时"),
OtherHourRate("OtherHourRate", "其他小时费率");
private final String code;
private final String name;
HourOrRateTypeEnum(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
/**
* 根据code获取text
*
* @param codeNo
* @return
*/
public static String getTextByCode(String codeNo) {
for (HourOrRateTypeEnum value : HourOrRateTypeEnum.values()) {
if (value.getCode().equals(codeNo)) {
return value.name();
}
}
return codeNo.toString();
}
/**
* 根据text获取code
*
* @param name
* @return
*/
public static String getCodeByName(String name) {
for (HourOrRateTypeEnum value : HourOrRateTypeEnum.values()) {
if (value.name().equals(name)) {
return value.name();
}
}
return name;
}
}
@@ -0,0 +1,58 @@
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 StandardStageEnum {
INIT("A", "初始"), FIRST_BATCH("B", "首批"), MASS_PRODUCTION("C", "量产");
private final String code;
private final String text;
StandardStageEnum(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 (StandardStageEnum value : StandardStageEnum.values()) {
if (value.getCode().equals(codeNo)) {
return value.getText();
}
}
return codeNo.toString();
}
/**
* 根据text获取code
*
* @param textStr
* @return
*/
public static String getCodeByText(String textStr) {
for (StandardStageEnum value : StandardStageEnum.values()) {
if (value.getText().equals(textStr)) {
return value.getText();
}
}
return textStr;
}
}
@@ -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 TotalCostEnum {
TotalLaborCost("TotalLaborCost", "总人工成本"), TotalMaterialCost("TotalMaterialCost", "总物料成本"), TotalEquipmentFee("TotalEquipmentFee", "总设备费"), TotalSupplyMaterialFee("TotalSupplyMaterialFee", "总辅料费"), TotalDriverFee("TotalDriverFee", "总水电费"), TotalOtherFee("TotalOtherFee", "总其他费用"), TotalLogisticsFee("TotalLogisticsFee", "总物流费"), TotalStandardCost("TotalStandardCost", "总标准成本");
private final String code;
private final String name;
TotalCostEnum(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
/**
* 根据code获取text
*
* @param codeNo
* @return
*/
public static String getTextByCode(String codeNo) {
for (TotalCostEnum value : TotalCostEnum.values()) {
if (value.getCode().equals(codeNo)) {
return value.name();
}
}
return codeNo.toString();
}
/**
* 根据text获取code
*
* @param name
* @return
*/
public static String getCodeByName(String name) {
for (TotalCostEnum value : TotalCostEnum.values()) {
if (value.name().equals(name)) {
return value.name();
}
}
return name;
}
}
@@ -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,14 @@
package com.zzsmart.qomo.kn.cost.manage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostHourRate;
/**
* @Description: app_scene_cost_hour_rate
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
public interface AppSceneCostHourRateMapper extends BaseMapper<AppSceneCostHourRate> {
}
@@ -0,0 +1,34 @@
package com.zzsmart.qomo.kn.cost.manage.mapper;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialBom;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* @Description: app_scene_cost_material_bom
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
public interface AppSceneCostMaterialBomMapper extends BaseMapper<AppSceneCostMaterialBom> {
/**
* 根据动态SQL语句查询物料BOM表
*
* @param selectCommand
* @return
*/
@Select("${selectCommand}")
List<AppSceneCostMaterialBom> customSelect(@Param("selectCommand") String selectCommand);
@Select("${selectSql}")
JSONObject customSelectOne(@Param("selectSql") String selectSql);
@Select("${SelectBlobModel}")
String customSelectBlobModelJson(@Param("SelectBlobModel") String SelectBlobModel);
}
@@ -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.AppSceneCostMaterialProcessHours;
/**
* @Description: app_scene_cost_material_process_hours
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
public interface AppSceneCostMaterialProcessHoursMapper extends BaseMapper<AppSceneCostMaterialProcessHours> {
}
@@ -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,14 @@
package com.zzsmart.qomo.kn.cost.manage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPartMissingInfo;
/**
* @Description: app_scene_cost_part_missing_info
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
public interface AppSceneCostPartMissingInfoMapper extends BaseMapper<AppSceneCostPartMissingInfo> {
}
@@ -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.AppSceneCostPurchaseEvaluate;
/**
* @Description: app_scene_cost_purchase_evaluate
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
public interface AppSceneCostPurchaseEvaluateMapper extends BaseMapper<AppSceneCostPurchaseEvaluate> {
}
@@ -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.AppSceneCostPurchasePrice;
/**
* @Description: app_scene_cost_purchase_price
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
public interface AppSceneCostPurchasePriceMapper extends BaseMapper<AppSceneCostPurchasePrice> {
}
@@ -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> {
}
@@ -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.AppSceneCostStandardDetail;
/**
* @Description: app_scene_cost_standard_detail
* @Author: jeecg-boot
* @Date: 2024-07-31
* @Version: V1.0
*/
public interface AppSceneCostStandardDetailMapper extends BaseMapper<AppSceneCostStandardDetail> {
}
@@ -0,0 +1,17 @@
package com.zzsmart.qomo.kn.cost.manage.mapper;
import java.util.List;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: app_scene_cost_standard_version
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
public interface AppSceneCostStandardVersionMapper extends BaseMapper<AppSceneCostStandardVersion> {
}
@@ -0,0 +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.AppSceneCostCountMapper">
</mapper>
@@ -0,0 +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.AppSceneCostHourRateMapper">
</mapper>
@@ -0,0 +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.AppSceneCostMaterialBomMapper">
</mapper>
@@ -0,0 +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.AppSceneCostMaterialProcessHoursMapper">
</mapper>
@@ -0,0 +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.AppSceneCostModelMapper">
</mapper>
@@ -0,0 +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.AppSceneCostPartMissingInfoMapper">
</mapper>
@@ -0,0 +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.AppSceneCostPurchaseEvaluateMapper">
</mapper>
@@ -0,0 +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.AppSceneCostPurchasePriceMapper">
</mapper>
@@ -0,0 +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.AppSceneCostResultValueMapper">
</mapper>
@@ -0,0 +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.AppSceneCostStandardDetailMapper">
</mapper>
@@ -0,0 +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.AppSceneCostStandardVersionMapper">
</mapper>
@@ -0,0 +1,721 @@
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.enums.HourOrRateTypeEnum;
import com.zzsmart.qomo.kn.cost.manage.enums.TotalCostEnum;
import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostMaterialBomMapper;
import com.zzsmart.qomo.kn.cost.manage.service.*;
import com.zzsmart.qomo.kn.cost.manage.vo.FlowTaskInfoVO;
import com.zzsmart.qomo.kn.cost.manage.vo.TotalResultValue;
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 org.springframework.transaction.annotation.Transactional;
import javax.annotation.PostConstruct;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Service
@Slf4j
@Transactional
public class StandardCostService {
/**
* 物料BOM信息
*/
@Autowired
AppSceneCostMaterialBomMapper costMaterialBomMapper;
@Autowired
IAppSceneCostMaterialBomService costMaterialBomService;
/**
* 小时费率
*/
@Autowired
IAppSceneCostHourRateService iHourRateService;
/**
* 采购单价
*/
@Autowired
IAppSceneCostPurchasePriceService costPurchasePriceService;
/**
* 工序
*/
@Autowired
IAppSceneCostMaterialProcessHoursService costMaterialProcessHoursService;
/**
* 标准成本计算结果
*/
@Autowired
IAppSceneCostResultValueService iAppSceneCostResultValueService;
/**
* 标准成本服务
*/
public static StandardCostService standardCostService;
/**
* 成本计算服务
*/
@Autowired
IAppSceneCostCountService appSceneCostCountService;
/**
* 标准成本明细服务(单行查询服务)
*/
@Autowired
private IAppSceneCostStandardDetailService iAppSceneCostStandardDetailService;
@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;
standardCostService.iAppSceneCostStandardDetailService = this.iAppSceneCostStandardDetailService;
}
/**
* 更新成本计算模型任务状态
*/
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);
//TODO 查询最顶部的BOM物料编号下所有的物料并进行层级排序
List<AppSceneCostMaterialBom> list = standardCostService.costMaterialBomService.queryAllBomInfoBytopMaterialCode(topMaterialCode);
log.info("Full EmptyTask list: {}", list);
//2.把查询的结果存放在临时表里(表命名规则:前缀_流程id_组件code)
for (int i = 0; list != null && i < list.size(); i++) {
AppSceneCostMaterialBom material = list.get(i);
AppSceneCostResultValue appSceneCostResultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(material.getMaterialCode()).parentMarterialNo(material.getParentMaterialCode()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).num(material.getNumber()).build();
standardCostService.iAppSceneCostResultValueService.save(appSceneCostResultValue);
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 获取任务流程相关信息
*
* @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).costType(feeType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").priceOrRate(price).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) {
AppSceneCostHourRate rate = JSON.toJavaObject(jsonObject, AppSceneCostHourRate.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<AppSceneCostMaterialProcessHours>> processHoursMap = standardCostService.costMaterialProcessHoursService.getProcessHoursByMaterialNo(MarterialNoList);
for (int i = 0; i < list.size(); i++) {
AppSceneCostResultValue appSceneCostResultValue = list.get(i);
String marterialNo = appSceneCostResultValue.getMarterialNo();
if (marterialNo != null) {
BigDecimal totalCost = new BigDecimal("0.0");
BigDecimal laborHours = new BigDecimal("0.0");
List<AppSceneCostMaterialProcessHours> costMaterialProcessHours = processHoursMap.get(marterialNo);
if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
for (int j = 0; j < costMaterialProcessHours.size(); j++) {
AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j);
laborHours = laborHours.add(processHours.getLaborHours());
//计算总人工成本
totalCost = totalCost.add(processHours.getLaborHours().multiply(hourRate));
}
}
//2.2计算出人工成本并存储到成本结果数据表中
AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build();
standardCostService.iAppSceneCostResultValueService.save(resultValue);
}
}
} catch (Exception e) {
throw new RuntimeException(e);
}
}
/**
* 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) {
AppSceneCostHourRate rate = JSON.toJavaObject(jsonObject, AppSceneCostHourRate.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<AppSceneCostMaterialProcessHours>> processHoursMap = standardCostService.costMaterialProcessHoursService.getProcessHoursByMaterialNo(MarterialNoList);
//2.1机器折旧费(机器工时*费率)
if (FeeTypeEnum.EquipmentFee.getCode().equals(feeType)) {
for (int i = 0; i < list.size(); i++) {
AppSceneCostResultValue appSceneCostResultValue = list.get(i);
String marterialNo = appSceneCostResultValue.getMarterialNo();
if (marterialNo != null) {
BigDecimal totalCost = new BigDecimal("0.0");
BigDecimal laborHours = new BigDecimal("0.0");
List<AppSceneCostMaterialProcessHours> costMaterialProcessHours = processHoursMap.get(marterialNo);
if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
for (int j = 0; j < costMaterialProcessHours.size(); j++) {
AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j);
laborHours = laborHours.add(processHours.getDeviceHours());
//计算机器成本
totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate));
}
}
//2.2计算机器成本并存储到成本结果数据表中
AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build();
standardCostService.iAppSceneCostResultValueService.save(resultValue);
}
}
} else if (FeeTypeEnum.SupplyMaterialFee.getCode().equals(feeType)) {
//机物料消耗(辅料工时*费率)
for (int i = 0; i < list.size(); i++) {
AppSceneCostResultValue appSceneCostResultValue = list.get(i);
String marterialNo = appSceneCostResultValue.getMarterialNo();
if (marterialNo != null) {
BigDecimal totalCost = new BigDecimal("0.0");
BigDecimal laborHours = new BigDecimal("0.0");
List<AppSceneCostMaterialProcessHours> costMaterialProcessHours = processHoursMap.get(marterialNo);
if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
for (int j = 0; j < costMaterialProcessHours.size(); j++) {
AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j);
//TODO 辅料工时来源
laborHours = laborHours.add(processHours.getDeviceHours());
//机物料消耗
totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate));
}
}
//2.2计算机物料消耗存储到成本结果数据表中
AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build();
standardCostService.iAppSceneCostResultValueService.save(resultValue);
}
}
} else if (FeeTypeEnum.DriverFee.getCode().equals(feeType)) {
//2.3水电费(燃动力工时*费率)
for (int i = 0; i < list.size(); i++) {
AppSceneCostResultValue appSceneCostResultValue = list.get(i);
String marterialNo = appSceneCostResultValue.getMarterialNo();
if (marterialNo != null) {
BigDecimal totalCost = new BigDecimal("0.0");
BigDecimal laborHours = new BigDecimal("0.0");
List<AppSceneCostMaterialProcessHours> costMaterialProcessHours = processHoursMap.get(marterialNo);
if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
for (int j = 0; j < costMaterialProcessHours.size(); j++) {
AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j);
//TODO 燃动力工时来源
laborHours = laborHours.add(processHours.getDeviceHours());
//水电费(燃动力工时*费率)成本
totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate));
}
}
//2.2计算机物料消耗存储到成本结果数据表中
AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build();
standardCostService.iAppSceneCostResultValueService.save(resultValue);
}
}
} else if (FeeTypeEnum.OtherFee.getCode().equals(feeType)) {
//2.4其他制费(其他工时*费率)
for (int i = 0; i < list.size(); i++) {
AppSceneCostResultValue appSceneCostResultValue = list.get(i);
String marterialNo = appSceneCostResultValue.getMarterialNo();
if (marterialNo != null) {
BigDecimal totalCost = new BigDecimal("0.0");
BigDecimal laborHours = new BigDecimal("0.0");
List<AppSceneCostMaterialProcessHours> costMaterialProcessHours = processHoursMap.get(marterialNo);
if (costMaterialProcessHours != null && costMaterialProcessHours.size() > 0) {
for (int j = 0; j < costMaterialProcessHours.size(); j++) {
AppSceneCostMaterialProcessHours processHours = costMaterialProcessHours.get(j);
//TODO 其他工时来源
laborHours = laborHours.add(processHours.getDeviceHours());
//其他制费成本
totalCost = totalCost.add(processHours.getDeviceHours().multiply(hourRate));
}
}
//2.2计算机物料消耗存储到成本结果数据表中
AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(marterialNo).parentMarterialNo(appSceneCostResultValue.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(totalCost + "").costType(feeType).priceOrRate(hourRate).hour(laborHours).build();
standardCostService.iAppSceneCostResultValueService.save(resultValue);
}
}
} else if (FeeTypeEnum.LogisticsFee.getCode().equals(feeType)) {
//查出所有的机器折旧费、机物料消耗、水电费、其他制费
list = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, "ManufacturingCost", flowInstanceId);
//2.5物流费((机器折旧+机物料消耗+水电费+其他制费)*10.16%)
//按照物料编号进行分组
Map<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) {
try {
//获取任务流程相关信息
FlowTaskInfoVO flowTaskInfoVO = analysisFlowTaskInfo(parameters);
//获取最上层的物料号
String topMaterialCode = flowTaskInfoVO.getTopMaterialCode();
//获取任务类型
String taskType = parameters.getTaskType();
//获取任务代码
String taskCode = flowTaskInfoVO.getTaskCode();
//获取流程id
String flowInstanceId = flowTaskInfoVO.getFlowInstanceId();
String costType = FeeTypeEnum.StandardCost.getCode();
//1.查询出根物料编号对应的下所有的BOM信息结果值
List<AppSceneCostResultValue> list = standardCostService.iAppSceneCostResultValueService.getAllResultValueByTopMaterialNo(topMaterialCode, 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);
//按照费用类别进行分组
Map<String, List<AppSceneCostResultValue>> costTypeMap = appSceneCostResultValues.stream().filter(s -> s.getCostType() != null).collect(Collectors.groupingBy(AppSceneCostResultValue::getCostType));
//【本阶标准成本】
BigDecimal currentCost = new BigDecimal("0.0");
//1.本阶物料成本
BigDecimal materialCost = new BigDecimal("0.0");
//2.本阶人工成本
BigDecimal laborCost = new BigDecimal("0.0");
//3.本阶制造费(设备费)
BigDecimal equipmentCost = new BigDecimal("0.0");
//4.本阶制造费(辅料费用)
BigDecimal supplyMaterialCost = new BigDecimal("0.0");
//5.本阶制造费(水电费、燃动费)
BigDecimal driveCost = new BigDecimal("0.0");
//6.本阶制造费(其他制造费用)
BigDecimal otherCost = new BigDecimal("0.0");
//7.本阶制造费(物流费)
BigDecimal logisticsCost = new BigDecimal("0.0");
//物料单价
BigDecimal materialUnitPrice = new BigDecimal("0.0");
//人员工时、小时费率
BigDecimal laborHour = new BigDecimal("0.0");
BigDecimal laborHourRate = new BigDecimal("0.0");
//设备工时、小时费率
BigDecimal equipmentHour = new BigDecimal("0.0");
BigDecimal equipmentHourRate = new BigDecimal("0.0");
//辅料工时、小时费率
BigDecimal supplyMaterialHour = new BigDecimal("0.0");
BigDecimal supplyMaterialHourRate = new BigDecimal("0.0");
//燃动工时、小时费率
BigDecimal driveHour = new BigDecimal("0.0");
BigDecimal driveHourRate = new BigDecimal("0.0");
//其他工时、小时费率
BigDecimal otherHour = new BigDecimal("0.0");
BigDecimal otherHourRate = new BigDecimal("0.0");
AppSceneCostResultValue currentMaterialCost = null;
//遍历所有费用类别计算本阶标准成本
for (int j = 0; j < appSceneCostResultValues.size(); j++) {
if (j == 0) {
currentMaterialCost = appSceneCostResultValues.get(0);
}
AppSceneCostResultValue appSceneCostResultValue = appSceneCostResultValues.get(j);
String countValue = appSceneCostResultValue.getCountValue();
if (countValue != null) {
currentCost = currentCost.add(new BigDecimal(countValue));
}
}
//计算本阶各个费用类别费用以及记录本阶物料的工时和小时费率
for (String feeType : costTypeMap.keySet()) {
List<AppSceneCostResultValue> appSceneCostResultValues1 = costTypeMap.get(feeType);
for (int m = 0; m < appSceneCostResultValues1.size(); m++) {
if (FeeTypeEnum.MaterialCost.getCode().equals(feeType)) {
//物料成本
materialCost = materialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
//物料单价
materialUnitPrice = appSceneCostResultValues1.get(m).getPriceOrRate();
} else if (FeeTypeEnum.LaborCost.getCode().equals(feeType)) {
//人工成本
laborCost = laborCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
//人工工时、小时费率
laborHour = laborHour.add(appSceneCostResultValues1.get(m).getHour());
laborHourRate = laborHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
} else if (FeeTypeEnum.EquipmentFee.getCode().equals(feeType)) {
//设备费用
equipmentCost = equipmentCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
//设备工时、小时费率
equipmentHour = equipmentHour.add(appSceneCostResultValues1.get(m).getHour());
equipmentHourRate = equipmentHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
} else if (FeeTypeEnum.SupplyMaterialFee.getCode().equals(feeType)) {
//辅料费用
supplyMaterialCost = supplyMaterialCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
//辅料工时、小时费率
supplyMaterialHour = supplyMaterialHour.add(appSceneCostResultValues1.get(m).getHour());
supplyMaterialHourRate = supplyMaterialHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
} else if (FeeTypeEnum.DriverFee.getCode().equals(feeType)) {
//燃动费用
driveCost = driveCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
//燃动工时、小时费率
driveHour = driveHour.add(appSceneCostResultValues1.get(m).getHour());
driveHourRate = driveHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
} else if (FeeTypeEnum.LogisticsFee.getCode().equals(feeType)) {
//物流费用
logisticsCost = logisticsCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
} else if (FeeTypeEnum.OtherFee.getCode().equals(feeType)) {
//其他费用
otherCost = otherCost.add(new BigDecimal(appSceneCostResultValues1.get(m).getCountValue()));
//其他工时、小时费率
otherHour = otherHour.add(appSceneCostResultValues1.get(m).getHour());
otherHourRate = otherHourRate.add(appSceneCostResultValues1.get(m).getPriceOrRate());
}
}
}
//本阶不同费用类别成本统计
JSONObject currentLevelCostTypeDetail = new JSONObject();
currentLevelCostTypeDetail.put(FeeTypeEnum.MaterialCost.getCode(), materialCost);
currentLevelCostTypeDetail.put(FeeTypeEnum.LaborCost.getCode(), laborCost);
currentLevelCostTypeDetail.put(FeeTypeEnum.EquipmentFee.getCode(), equipmentCost);
currentLevelCostTypeDetail.put(FeeTypeEnum.SupplyMaterialFee.getCode(), supplyMaterialCost);
currentLevelCostTypeDetail.put(FeeTypeEnum.DriverFee.getCode(), driveCost);
currentLevelCostTypeDetail.put(FeeTypeEnum.LogisticsFee.getCode(), logisticsCost);
currentLevelCostTypeDetail.put(FeeTypeEnum.OtherFee.getCode(), otherCost);
//统计本阶不同费用类别工时、小时费率
currentLevelCostTypeDetail.put(HourOrRateTypeEnum.MaterialUnitPrice.getCode(), materialUnitPrice);
currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHour.getCode(), laborHour);
currentLevelCostTypeDetail.put(HourOrRateTypeEnum.LaborHourRate.getCode(), laborHourRate);
currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHour.getCode(), equipmentHour);
currentLevelCostTypeDetail.put(HourOrRateTypeEnum.EquipmentHourRate.getCode(), equipmentHourRate);
currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHour.getCode(), supplyMaterialHour);
currentLevelCostTypeDetail.put(HourOrRateTypeEnum.SupplyMaterialHourRate.getCode(), supplyMaterialHourRate);
currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHour.getCode(), driveHour);
currentLevelCostTypeDetail.put(HourOrRateTypeEnum.DriverHourRate.getCode(), driveHourRate);
currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHour.getCode(), otherHour);
currentLevelCostTypeDetail.put(HourOrRateTypeEnum.OtherHourRate.getCode(), otherHourRate);
AppSceneCostResultValue resultValue = AppSceneCostResultValue.builder().belongTopMaterialNo(topMaterialCode).marterialNo(key).parentMarterialNo(currentMaterialCost.getParentMarterialNo()).taskType(taskType).taskCode(taskCode).flowInstanceId(flowInstanceId).countValue(currentCost.toString()).costDetail(JSON.toJSONString(currentLevelCostTypeDetail)).costType(costType).build();
standardCostService.iAppSceneCostResultValueService.save(resultValue);
}
//3.计算出所有的单个物料的累计标准成本
List<AppSceneCostResultValue> standardCostList = standardCostService.iAppSceneCostResultValueService.getResultValueByTopMaterialNo(topMaterialCode, taskType, flowInstanceId);
//【累计成本】的计算
totalCountCost(standardCostList, topMaterialCode, taskType, taskCode, flowInstanceId);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("计算成本失败");
}
}
/**
* 循环算出各个物料的累计成本
*
* @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) {
try {
List<AppSceneCostStandardDetail> costStandardDetails = new ArrayList<>();
//父类对应的子节点(除了最上层节点)
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());
//循环计算出当前节点的累计成本
String costDetail = oldAppSceneCostResultValue.getCostDetail();
//查询当前节点各个类型的成本
BigDecimal totalMaterialCost = new BigDecimal(0);
BigDecimal totalLabourCost = new BigDecimal(0);
BigDecimal totalEquipmentCost = new BigDecimal(0);
BigDecimal totalSupplyMaterialCost = new BigDecimal(0);
BigDecimal totalDriveCost = new BigDecimal(0);
BigDecimal totalLogisticsCost = new BigDecimal(0);
BigDecimal totalOtherCost = new BigDecimal(0);
JSONObject costDetailJson = JSON.parseObject(costDetail);
TotalResultValue hourOrRateResultValue = loopCount(oldAppSceneCostResultValue, parentMaterialNoMap, totalMaterialCost, totalLabourCost, totalEquipmentCost, totalSupplyMaterialCost, totalDriveCost, totalLogisticsCost, totalOtherCost, totalCost);
costDetailJson.put(TotalCostEnum.TotalMaterialCost.getCode(), hourOrRateResultValue.getTotalMaterialCost());
costDetailJson.put(TotalCostEnum.TotalLaborCost.getCode(), hourOrRateResultValue.getTotalLabourCost());
costDetailJson.put(TotalCostEnum.TotalEquipmentFee.getCode(), hourOrRateResultValue.getTotalEquipmentCost());
costDetailJson.put(TotalCostEnum.TotalSupplyMaterialFee.getCode(), hourOrRateResultValue.getTotalSupplyMaterialCost());
costDetailJson.put(TotalCostEnum.TotalDriverFee.getCode(), hourOrRateResultValue.getTotalDriveCost());
costDetailJson.put(TotalCostEnum.TotalLogisticsFee.getCode(), hourOrRateResultValue.getTotalLogisticsCost());
costDetailJson.put(TotalCostEnum.TotalOtherFee.getCode(), hourOrRateResultValue.getTotalOtherCost());
costDetailJson.put(TotalCostEnum.TotalStandardCost.getCode(), hourOrRateResultValue.getTotalCost());
oldAppSceneCostResultValue.setCostDetail(costDetailJson.toJSONString());
oldAppSceneCostResultValue.setTotalValue(hourOrRateResultValue.getTotalCost().toString());
standardCostService.iAppSceneCostResultValueService.updateById(oldAppSceneCostResultValue);
//构造单行成本查询记录
AppSceneCostStandardDetail costStandardDetail = AppSceneCostStandardDetail.builder().materialNumber(oldAppSceneCostResultValue.getMarterialNo()).materialName(oldAppSceneCostResultValue.getMarterialNo()).parentMaterialNumber(oldAppSceneCostResultValue.getParentMarterialNo())
// .versionNumber()
// .level()
// .sort()
// .figureNumber()
.dosage(oldAppSceneCostResultValue.getNum() != null ? new Double(oldAppSceneCostResultValue.getNum()) : 0).unit(oldAppSceneCostResultValue.getUnit()).materialCost(costDetailJson.getBigDecimal(FeeTypeEnum.MaterialCost.getCode())).laborCost(costDetailJson.getBigDecimal(FeeTypeEnum.LaborCost.getCode())).equipmentCost(costDetailJson.getBigDecimal(FeeTypeEnum.EquipmentFee.getCode())).supplyMaterialCost(costDetailJson.getBigDecimal(FeeTypeEnum.SupplyMaterialFee.getCode())).driveCost(costDetailJson.getBigDecimal(FeeTypeEnum.DriverFee.getCode())).logisticsCost(costDetailJson.getBigDecimal(FeeTypeEnum.LogisticsFee.getCode())).otherCost(costDetailJson.getBigDecimal(FeeTypeEnum.OtherFee.getCode())).currentStandardCost(new BigDecimal(oldAppSceneCostResultValue.getCountValue())).totalMaterialCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalMaterialCost.getCode())).totalLaborCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalLaborCost.getCode())).totalEquipmentCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalEquipmentFee.getCode())).totalSupplyMaterialCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalSupplyMaterialFee.getCode())).totalDriveCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalDriverFee.getCode())).totalLogisticsCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalLogisticsFee.getCode())).totalOtherCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalOtherFee.getCode())).totalStandardCost(costDetailJson.getBigDecimal(TotalCostEnum.TotalStandardCost.getCode())).createTime(new Date()).build();
costStandardDetails.add(costStandardDetail);
}
//更新结果集到标准成本单行查询中去
standardCostService.iAppSceneCostStandardDetailService.saveBatch(costStandardDetails);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* //循环算出各个物料的累计成本
* 递归计算出累计成本
*
* @param appSceneCostResultValue
* @param parentMaterialNoMap
*/
private static TotalResultValue loopCount(AppSceneCostResultValue appSceneCostResultValue, Map<String, List<AppSceneCostResultValue>> parentMaterialNoMap, BigDecimal totalMaterialCost, BigDecimal totalLabourCost, BigDecimal totalEquipmentCost, BigDecimal totalSupplyMaterialCost, BigDecimal totalDriveCost, BigDecimal totalLogisticsCost, BigDecimal totalOtherCost, 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));
}
//各个费用类别成本累计
if (appSceneCostResultValue1.getCostDetail() != null) {
JSONObject costDetailJson = JSON.parseObject(appSceneCostResultValue1.getCostDetail());
if (costDetailJson != null) {
totalMaterialCost = totalMaterialCost.add(costDetailJson.getBigDecimal(FeeTypeEnum.MaterialCost.getCode()));
totalLabourCost = totalLabourCost.add(costDetailJson.getBigDecimal(FeeTypeEnum.LaborCost.getCode()));
totalEquipmentCost = totalEquipmentCost.add(costDetailJson.getBigDecimal(FeeTypeEnum.EquipmentFee.getCode()));
totalSupplyMaterialCost = totalSupplyMaterialCost.add(costDetailJson.getBigDecimal(FeeTypeEnum.SupplyMaterialFee.getCode()));
totalDriveCost = totalDriveCost.add(costDetailJson.getBigDecimal(FeeTypeEnum.DriverFee.getCode()));
totalLogisticsCost = totalLogisticsCost.add(costDetailJson.getBigDecimal(FeeTypeEnum.LogisticsFee.getCode()));
totalOtherCost = totalOtherCost.add(costDetailJson.getBigDecimal(FeeTypeEnum.OtherFee.getCode()));
}
}
//判断当前子节点是否还有子节点
if (parentMaterialNoMap.containsKey(appSceneCostResultValue1.getMarterialNo())) {
//如果还有子节点则继续递归
loopCount(appSceneCostResultValue1, parentMaterialNoMap, totalMaterialCost, totalLabourCost, totalEquipmentCost, totalSupplyMaterialCost, totalDriveCost, totalLogisticsCost, totalOtherCost, totalCost);
}
}
}
TotalResultValue hourOrRateResultValue = TotalResultValue.builder().totalMaterialCost(totalMaterialCost).totalLabourCost(totalLabourCost).totalEquipmentCost(totalEquipmentCost).totalSupplyMaterialCost(totalSupplyMaterialCost).totalDriveCost(totalDriveCost).totalLogisticsCost(totalLogisticsCost).totalOtherCost(totalOtherCost).totalCost(totalCost).build();
appSceneCostResultValue.setTotalValue(totalCost.toString());
return hourOrRateResultValue;
}
}
@@ -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();
}
}
@@ -0,0 +1,14 @@
package com.zzsmart.qomo.kn.cost.manage.service;
import com.zzsmart.qomo.kn.cost.manage.vo.BomTreeInfoVO;
import java.util.List;
public interface BomTreeService {
/**
* 根据物料号查询物料树
* @param materialNumber
* @return
*/
List<BomTreeInfoVO> getBomTreeByMaterialNumber(String materialNumber, String version_number);
}
@@ -0,0 +1,35 @@
package com.zzsmart.qomo.kn.cost.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount;
import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO;
import java.util.List;
/**
* @Description: app_scene_cost_count
* @Author: jeecg-boot
* @Date: 2024-07-29
* @Version: V1.0
*/
public interface IAppSceneCostCountService extends IService<AppSceneCostCount> {
/**
* 查看关键缺失部件
* @param id
* @return
*/
List<MissingComponentVO> queryMissingComponentById(String id);
/**
* 重新计算
* @param id
* @return
*/
AppSceneCostCount recountById(Integer id);
/**
* 添加标准成本计算任务
* @param appSceneCostCount
*/
void addCostCountTask(AppSceneCostCount appSceneCostCount);
}
@@ -0,0 +1,14 @@
package com.zzsmart.qomo.kn.cost.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostHourRate;
/**
* @Description: app_scene_cost_hour_rate
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
public interface IAppSceneCostHourRateService extends IService<AppSceneCostHourRate> {
}
@@ -0,0 +1,28 @@
package com.zzsmart.qomo.kn.cost.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialBom;
import java.util.List;
/**
* @Description: app_scene_cost_material_bom
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
public interface IAppSceneCostMaterialBomService extends IService<AppSceneCostMaterialBom> {
/**
* 分页查询
* @param
* @return
*/
List<AppSceneCostMaterialBom> queryListResult(String materialNumber);
/**
* 查询最顶层物料编号下所有的物料
* @param topMaterialCode
* @return
*/
List<AppSceneCostMaterialBom> queryAllBomInfoBytopMaterialCode(String topMaterialCode);
}
@@ -0,0 +1,22 @@
package com.zzsmart.qomo.kn.cost.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostMaterialProcessHours;
import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostMaterialProcessHoursMapper;
import java.util.List;
import java.util.Map;
/**
* @Description: app_scene_cost_material_process_hours
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
public interface IAppSceneCostMaterialProcessHoursService extends IService<AppSceneCostMaterialProcessHours> {
/**
* 查询满足物料编号的工时工序
*/
Map<String, List<AppSceneCostMaterialProcessHours>> getProcessHoursByMaterialNo(List<String> materialNos);
}
@@ -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,14 @@
package com.zzsmart.qomo.kn.cost.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPartMissingInfo;
/**
* @Description: app_scene_cost_part_missing_info
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
public interface IAppSceneCostPartMissingInfoService extends IService<AppSceneCostPartMissingInfo> {
}
@@ -0,0 +1,14 @@
package com.zzsmart.qomo.kn.cost.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchaseEvaluate;
/**
* @Description: app_scene_cost_purchase_evaluate
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
public interface IAppSceneCostPurchaseEvaluateService extends IService<AppSceneCostPurchaseEvaluate> {
}
@@ -0,0 +1,22 @@
package com.zzsmart.qomo.kn.cost.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPurchasePrice;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
* @Description: app_scene_cost_purchase_price
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
public interface IAppSceneCostPurchasePriceService extends IService<AppSceneCostPurchasePrice> {
/**
* 查询满足物料编号的最低采购价
*/
Map<String, BigDecimal> getMinCostPurchasePriceByMaterialNo(List<String> materialNos);
}
@@ -0,0 +1,31 @@
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);
/**
* 查询根物料的某次成本计算流程下的所有结果值
*
* @param topMaterialCode
* @param flowInstanceId
* @return
*/
List<AppSceneCostResultValue> getAllResultValueByTopMaterialNo(String topMaterialCode, String flowInstanceId);
}
@@ -0,0 +1,14 @@
package com.zzsmart.qomo.kn.cost.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardDetail;
/**
* @Description: app_scene_cost_standard_detail
* @Author: jeecg-boot
* @Date: 2024-07-31
* @Version: V1.0
*/
public interface IAppSceneCostStandardDetailService extends IService<AppSceneCostStandardDetail> {
}
@@ -0,0 +1,14 @@
package com.zzsmart.qomo.kn.cost.manage.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion;
/**
* @Description: app_scene_cost_standard_version
* @Author: jeecg-boot
* @Date: 2024-08-02
* @Version: V1.0
*/
public interface IAppSceneCostStandardVersionService extends IService<AppSceneCostStandardVersion> {
}
@@ -0,0 +1,122 @@
package com.zzsmart.qomo.kn.cost.manage.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsmart.qomo.dao.entity.FlowDefinition;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostCount;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostPartMissingInfo;
import com.zzsmart.qomo.kn.cost.manage.entity.AppSceneCostStandardVersion;
import com.zzsmart.qomo.kn.cost.manage.enums.CostCountStatusEnum;
import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostCountMapper;
import com.zzsmart.qomo.kn.cost.manage.mapper.AppSceneCostPartMissingInfoMapper;
import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostCountService;
import com.zzsmart.qomo.kn.cost.manage.service.IAppSceneCostStandardVersionService;
import com.zzsmart.qomo.kn.cost.manage.vo.MissingComponentVO;
import com.zzsmart.qomo.service.IDataFlowDefinitionService;
import com.zzsmart.qomo.service.IDataFlowInstanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @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 IAppSceneCostStandardVersionService costStandardVersionService;
@Autowired
private IDataFlowInstanceService flowInstanceService;
@Autowired
private AppSceneCostPartMissingInfoMapper costPartMissingInfoMapper;
/**
* 查看关键缺失部件
*
* @param id
* @return
*/
@Override
public List<MissingComponentVO> queryMissingComponentById(String id) {
List<MissingComponentVO> list = new ArrayList<>();
if (id != null) {
QueryWrapper<AppSceneCostPartMissingInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("costStandardId", id);
List<AppSceneCostPartMissingInfo> costPartMissingInfos = costPartMissingInfoMapper.selectList(queryWrapper);
if (costPartMissingInfos != null && costPartMissingInfos.size() > 0) {
for (int i = 0; i < costPartMissingInfos.size(); i++) {
AppSceneCostPartMissingInfo costPartMissingInfo = costPartMissingInfos.get(i);
if (costPartMissingInfo.getMissingInfo() != null) {
String[] split = costPartMissingInfo.getMissingInfo().split(";");
for (int j = 0; j < split.length; j++) {
MissingComponentVO temp = MissingComponentVO.builder().materialNumber(costPartMissingInfo.getMaterialNumber()).missingInfo(split[j]).versionNumber(costPartMissingInfo.getVersionNumber()).build();
list.add(temp);
}
}
}
}
}
return list;
}
/**
* 重新计算
*
* @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.新增版本号记录成功后
AppSceneCostStandardVersion costStandardVersion = AppSceneCostStandardVersion.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(costStandardVersion.getVersionNumber()).status(CostCountStatusEnum.Executing.getValue()).createTime(new Date()).build();
boolean flag = save(appSceneCostCount1);
if (flag) {
//发送更新成本计算状态的队列消息(队列名:updateCostCountStatus)
//执行标准成本计算
executeStandardCost(appSceneCostCount1.getId(), appSceneCostCount1.getFlowDefinitionId());
//TODO 新增部件缺失信息记录
AppSceneCostPartMissingInfo costPartMissingInfo = AppSceneCostPartMissingInfo.builder().costStandardId(appSceneCostCount1.getId().toString()).materialNumber(appSceneCostCount1.getMaterialNo()).versionNumber(appSceneCostCount1.getCostVersion()).missingInfo("电源线;绝缘层涂料").build();
costPartMissingInfoMapper.insert(costPartMissingInfo);
}
}
}
}

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